 
* { box-sizing: border-box; margin: 0; padding: 0; }
/* Slightly darkened background so the white chat panel pops */
body { font-family: 'Inter', sans-serif; background: #eef0f4; display: flex; justify-content: center; align-items: center; height: 100vh; color: #333; }
h1, h2, h3 { font-family: 'Playfair Display', serif; }

/* =========================================
   MODERN SAAS LOGIN (Asymmetrical & Features)
   ========================================= */
#loginContainer { display: none; }
#loginContainer.modern-login-layout { display: flex; height: 100vh; width: 100vw; position: absolute; top: 0; left: 0; z-index: 1000; background: #f9fafb; font-family: 'Inter', sans-serif; }

/* LEFT SIDEBAR (Navy - 35% width) */
.login-sidebar { flex: 0 0 420px; background-color: #181D32; display: flex; flex-direction: column; justify-content: space-between; padding: 40px; color: #fff; box-shadow: 4px 0 24px rgba(0,0,0,0.1); z-index: 10; }
.login-header { display: flex; align-items: center; gap: 12px; }
.login-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255,255,255,0.2); }
.brand-text { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 600; }

.form-wrapper { flex: 1; display: flex; flex-direction: column; justify-content: center; }
h1.auth-title { font-family: 'Playfair Display', serif; font-size: 2.5rem; margin: 0 0 10px 0; line-height: 1.1; }
p.auth-subtitle { color: rgba(255,255,255,0.7); font-size: 15px; margin: 0 0 40px 0; }

label.auth-label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; color: #B99784; }
/* FORM INPUTS & FIXING INTL-TEL-INPUT OVERLAP */
input.auth-input { 
    width: 100% !important; 
    padding: 14px 16px !important; /* Sets standard padding for the 6-digit code box */
    border-radius: 8px !important; 
    font-size: 16px; 
    background: rgba(255,255,255,0.05) !important; 
    border: 1px solid rgba(255,255,255,0.1) !important; 
    color: #fff !important; 
    box-sizing: border-box; 
    transition: 0.2s; 
}
input.auth-input:focus { outline: none; border-color: #B99784 !important; background: rgba(255,255,255,0.1) !important; }

/* Specific fixes for the flag dropdown */
.iti { width: 100%; margin-bottom: 25px; }

/* 🔥 THE FIX: This forces ONLY the phone input to start 90px from the left */
.iti input.auth-input { padding-left: 90px !important; }

.iti__selected-flag { padding: 0 16px !important; border-radius: 8px 0 0 8px; background: transparent !important; }
.iti__country-list { background: #181D32; border: 1px solid #3d4363; color: white; border-radius: 8px; }
.iti__country-list .iti__country:hover { background: rgba(255,255,255,0.1); }

/* Taupe Button */
button.auth-button { background-color: #B99784; color: #fff; border: none; padding: 14px 24px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 16px; width: 100%; transition: 0.2s; margin-top: 10px; }
button.auth-button:hover { background-color: #AA8877; transform: translateY(-1px); }
/* Disclaimer */
.disclaimer-footer { font-size: 12px; color: rgba(255,255,255,0.5); line-height: 1.6; }
.disclaimer-footer a { color: #B99784; text-decoration: none; }
.disclaimer-footer a:hover { text-decoration: underline; }

/* RIGHT SHOWCASE PANE (Light - 65% width) */
.feature-showcase { flex: 1; display: flex; align-items: center; justify-content: center; padding: 60px; background: radial-gradient(circle at top right, #ffffff, #f0f2f5); }
.showcase-content { max-width: 600px; width: 100%; }
h2.showcase-headline { font-family: 'Playfair Display', serif; font-size: 3rem; color: #181D32; line-height: 1.2; margin-bottom: 50px; min-height: 120px; }
.typed-cursor { color: #B99784; }

/* Feature Grid (Now with custom Taupe Bullets) */
.feature-grid { display: flex; flex-direction: column; gap: 24px; }
.feature-card { display: flex; gap: 16px; align-items: flex-start; }
.feat-icon { width: 10px; height: 10px; background: #B99784; border-radius: 50%; margin-top: 6px; flex-shrink: 0; box-shadow: 0 0 10px rgba(185, 151, 132, 0.4); }
.feat-text h3 { font-family: 'Inter', sans-serif; font-size: 19px; font-weight: 600; color: #181D32; margin: 0 0 4px 0; }
.feat-text p { margin: 0; font-size: 15px; color: #666; line-height: 1.6; }
/* FLOATING PANEL LAYOUT (NOTEBOOK LM STYLE) */
#dashboardContainer { display: none; width: 98%; max-width: 1600px; height: 94vh; background: transparent; overflow: hidden; flex-direction: row; gap: 16px; padding: 10px; }

/* LEFT SIDEBAR (Chats) */
.sidebar { width: 280px; min-width: 280px; background: #181d32; color: white; display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.sidebar-header { padding: 20px; }
.sidebar-brand { font-family: 'Playfair Display', serif; font-size: 20px; color: #fff; margin-bottom: 15px; }
.new-chat-btn { background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.15); padding: 11px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; width: 100%; text-align: left; display: flex; align-items: center; gap: 8px; transition: 0.2s; }
.new-chat-btn:hover { background: rgba(255,255,255,0.15); }

.sidebar-label { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 1px; padding: 12px 20px 6px 20px; }

.chat-list { flex: 1; overflow-y: auto; padding: 0 8px; min-height: 0; }
.chat-list::-webkit-scrollbar { width: 5px; }
.chat-list::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
.chat-item { padding: 10px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; color: #bbb; transition: 0.15s; display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 2px; }
.chat-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.chat-item:hover .chat-delete-btn { opacity: 1; }
.chat-item.active { background: rgba(184,147,116,0.2); color: #fff; border-left: 3px solid #b89374; }
.chat-item-text { flex: 1; min-width: 0; }
.chat-item-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.chat-item-date { font-size: 10px; color: #555; display: block; margin-top: 2px; }

.chat-action-btn { opacity: 0; background: none; border: none; color: #aaa; cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 4px; transition: 0.15s; flex-shrink: 0; }
.chat-item:hover .chat-action-btn { opacity: 1; }
.chat-action-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.chat-delete-btn:hover { background: rgba(255,0,0,0.15); color: #ff4c4c; }
.chat-actions-container { display: flex; gap: 2px; flex-shrink: 0; }

/* CENTER CHAT AREA */
.chat-area { flex: 1; display: flex; flex-direction: column; background: #fff; min-width: 0; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.06); overflow: hidden; }
.chat-header { padding: 16px 30px; background: white; border-bottom: 1px solid #eaeaea; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.header-title { font-family: 'Playfair Display', serif; font-weight: 600; font-size: 22px; color: #181d32; }
.header-actions { display: flex; align-items: center; gap: 15px; font-size: 13px; }
.logout-btn { background: transparent; border: 1px solid #ddd; padding: 6px 12px; border-radius: 4px; cursor: pointer; color: #666; font-size: 13px; }
.logout-btn:hover { background: #f4f4f4; color: #181d32; }

.messages { flex: 1; padding: 30px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; background: #fafafa; min-height: 0; }
.message-wrapper { display: flex; align-items: flex-end; gap: 12px; max-width: 80%; }
.wrapper-bot { align-self: flex-start; }
.wrapper-user { align-self: flex-end; flex-direction: row-reverse; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; box-shadow: 0 2px 5px rgba(0,0,0,0.1); border: 1px solid #ddd; flex-shrink: 0; }
.message { padding: 13px 17px; border-radius: 12px; line-height: 1.6; font-size: 14px; }
.msg-user { background: #181d32; color: white; border-bottom-right-radius: 2px; }
.msg-bot { background: #fff; color: #333; border-bottom-left-radius: 2px; border: 1px solid #eaeaea; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; color: #bbb; text-align: center; padding: 40px; }
.empty-state h3 { font-family: 'Playfair Display', serif; color: #999; font-size: 20px; margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 400px; line-height: 1.6; }

/* DEEP DIVE TOGGLE CSS WITH TOOLTIP */
.deep-dive-bar { padding: 12px 30px; background: white; border-top: 1px solid #eaeaea; display: flex; align-items: center; justify-content: flex-end; flex-shrink: 0; gap: 10px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #181d32; }
input:checked + .slider:before { transform: translateX(18px); }
.toggle-label { font-weight: 600; font-size: 13px; color: #444; cursor: pointer; }

.tooltip-container { position: relative; display: inline-block; cursor: help; color: #888; border-bottom: 1px dotted #888; font-size: 12px; }
.tooltip-text { visibility: hidden; width: 260px; background-color: #181d32; color: #fff; text-align: center; border-radius: 8px; padding: 12px; position: absolute; z-index: 10; bottom: 140%; right: 0; opacity: 0; transition: opacity 0.3s; font-size: 12px; line-height: 1.5; font-weight: 400; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.tooltip-text::after { content: ""; position: absolute; top: 100%; right: 20px; border-width: 5px; border-style: solid; border-color: #181d32 transparent transparent transparent; }
.tooltip-container:hover .tooltip-text { visibility: visible; opacity: 1; }

.chat-input-area { padding: 15px 30px 25px 30px; background: white; display: flex; gap: 12px; align-items: center; flex-shrink: 0; }
.chat-input-area input { flex-grow: 1; padding: 14px 20px; border: 1px solid #ddd; border-radius: 30px; outline: none; font-size: 15px; background: #fafafa; }
.chat-input-area input:focus { border-color: #181d32; background: white; }
.chat-input-area button { background: #181d32; color: white; border: none; padding: 14px 28px; border-radius: 30px; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; }
.chat-input-area button:hover { background: #252b48; }
.chat-input-area button:disabled { opacity: 0.5; cursor: not-allowed; }
/* CHAT SEARCH & FILTER CONTROLS */
.sidebar-controls { padding: 0 16px 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.sidebar-search { position: relative; }
.sidebar-search input { width: 100%; padding: 8px 12px 8px 28px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.05); color: white; font-size: 12px; outline: none; transition: 0.2s; }
.sidebar-search input:focus { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.08); }
.sidebar-search input::placeholder { color: #888; }
.sidebar-search-icon { position: absolute; left: 10px; top: 9px; color: #888; font-size: 11px; }

.sidebar-filter { width: 100%; padding: 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.05); color: #ccc; font-size: 12px; outline: none; cursor: pointer; }
.sidebar-filter option { background: #181d32; color: white; }

/* KNOWLEDGE BASE TOOLTIP */
.kb-tooltip-container { position: relative; display: inline-block; cursor: help; margin-left: 8px; font-size: 14px; color: #888; vertical-align: middle; }
.kb-tooltip-text { visibility: hidden; width: 230px; background-color: #252b48; color: #fff; text-align: left; border-radius: 8px; padding: 12px; position: absolute; z-index: 9999; top: 130%; right: -10px; left: auto; opacity: 0; transition: opacity 0.3s; font-size: 12px; line-height: 1.5; font-weight: 400; box-shadow: 0 4px 15px rgba(0,0,0,0.5); font-family: 'Inter', sans-serif; }
.kb-tooltip-text::after { content: ""; position: absolute; bottom: 100%; right: 16px; left: auto; border-width: 5px; border-style: solid; border-color: transparent transparent #252b48 transparent; }
.kb-tooltip-container:hover .kb-tooltip-text { visibility: visible; opacity: 1; }
/* RIGHT SIDEBAR (Memory Bank) */
.right-sidebar { width: 320px; min-width: 320px; background: #111424; color: white; display: flex; flex-direction: column; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); /* Removed overflow: hidden so tooltip can escape! */ }
.right-header { padding: 20px; font-family: 'Playfair Display', serif; font-size: 18px; color: #fff; display: flex; align-items: center; justify-content: space-between; }

.search-container { padding: 0 16px 12px 16px; position: relative; }
.search-container input { width: 100%; padding: 10px 14px 10px 32px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.03); color: white; font-size: 13px; outline: none; transition: 0.2s; }
.search-container input:focus { border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.08); }
.search-container input::placeholder { color: #666; }
.search-icon { position: absolute; left: 26px; top: 11px; color: #666; font-size: 12px; }

.docs-section { flex: 1; overflow-y: auto; padding: 0 8px; }
.docs-section::-webkit-scrollbar { width: 5px; }
.docs-section::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

.doc-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 8px; position: relative; margin-bottom: 2px; border: 1px solid transparent; }
.doc-row:hover { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.05); }

.doc-label { display: flex; align-items: center; gap: 10px; cursor: pointer; flex-grow: 1; overflow: hidden; }

/* MUTED FILE ICONS (Smaller & Darker) */
.doc-icon { width: 18px; height: 22px; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: bold; flex-shrink: 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.icon-pdf { background: rgba(255, 76, 76, 0.15); color: #ff6b6b; border: 1px solid rgba(255, 76, 76, 0.3); }
.icon-doc { background: rgba(76, 131, 255, 0.15); color: #6b9fff; border: 1px solid rgba(76, 131, 255, 0.3); }
.icon-txt { background: rgba(255, 255, 255, 0.1); color: #ccc; border: 1px solid rgba(255, 255, 255, 0.2); }

.doc-info { display: flex; flex-direction: column; overflow: hidden; }
.doc-name { color: #eaeaea; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-date { font-size: 10px; color: #777; margin-top: 2px; }

/* 3 DOTS MENU */
.doc-menu-wrapper { position: relative; }
.doc-menu-btn { background: transparent; border: none; color: #888; cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 4px; opacity: 0; transition: 0.2s; line-height: 1; }
.doc-row:hover .doc-menu-btn { opacity: 1; }
.doc-menu-btn:hover { background: rgba(255,255,255,0.1); color: white; }

.doc-dropdown { position: absolute; right: 0; top: 25px; background: #252b48; border: 1px solid #3d4363; border-radius: 8px; box-shadow: 0 6px 16px rgba(0,0,0,0.3); display: none; flex-direction: column; z-index: 100; min-width: 120px; overflow: hidden; }
.doc-dropdown.show { display: flex; }
.doc-dropdown button { background: transparent; border: none; color: #ddd; padding: 10px 14px; text-align: left; font-size: 13px; cursor: pointer; transition: 0.2s; }
.doc-dropdown button:hover { background: rgba(255,255,255,0.08); color: white; }
.doc-dropdown button.delete-btn { color: #ff6b6b; border-top: 1px solid rgba(255,255,255,0.05); }
.doc-dropdown button.delete-btn:hover { background: rgba(255,0,0,0.15); color: #ff4c4c; }

.upload-box { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.05); background: #15182a; border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; }
.upload-box input[type="file"] { margin-bottom: 10px; width: 100%; font-size: 11px; color: #aaa; }
.upload-box input[type="file"]::file-selector-button { background: rgba(255,255,255,0.05); color: white; border: 1px solid rgba(255,255,255,0.1); padding: 6px 12px; border-radius: 4px; cursor: pointer; margin-right: 10px; transition: 0.2s; }
.upload-box input[type="file"]::file-selector-button:hover { background: rgba(255,255,255,0.1); }
.upload-btn { background: white; color: #111424; border: none; padding: 12px; border-radius: 8px; cursor: pointer; width: 100%; font-weight: 600; font-size: 13px; transition: 0.2s; }
.upload-btn:hover { background: #e0e0e0; }
#uploadStatus { font-size: 11px; margin-top: 8px; color: #aaa; text-align: center; }


/* MARKDOWN CHAT STYLES */
.message p { margin-bottom: 12px; }
.message p:last-child { margin-bottom: 0; }
.message strong { font-weight: 600; color: #000; }
.message ul, .message ol { margin-left: 20px; margin-bottom: 12px; }
.message li { margin-bottom: 4px; }


/* TYPING INDICATOR */
.typing-wrapper { display: flex; align-items: flex-end; gap: 12px; max-width: 80%; margin-bottom: 20px; }
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 15px 17px;
    background: #fff;
    border-radius: 12px;
    border-bottom-left-radius: 2px;
    border: 1px solid #eaeaea;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    height: 44px;
}
.typing-indicator span {
    width: 6px;
    height: 6px;
    background-color: #bbb;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* COPY WIDGET STYLES */
.copy-action-btn {
    background: transparent; border: none; color: #999; cursor: pointer;
    font-size: 11px; margin-top: 6px; padding: 2px 4px; transition: 0.2s;
    opacity: 0; font-weight: 500; font-family: 'Inter', sans-serif;
}
.message-wrapper:hover .copy-action-btn { opacity: 1; }
.copy-action-btn:hover { color: #181d32; }