:root {
    --primary-color: #00a67e;
    --primary-light: #e6f6f1;
    --text-main: #333333;
    --text-muted: #6b7280;
    --bg-main: #ffffff;
    --bg-sidebar: #fafafa;
    --border-color: #e5e7eb;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.app-shell { 
    display: flex; 
    height: 100%; 
}

/* Sidebar */
.sidebar { 
    width: 260px; 
    background: var(--bg-main); 
    padding: 24px; 
    border-right: 1px solid var(--border-color); 
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.02);
    z-index: 10;
}

.brand { 
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px; 
}

.brand-icon {
    background-color: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon {
    width: 24px;
    height: 24px;
}

.brand-text h1 { 
    font-weight: 700; 
    color: var(--primary-color); 
    font-size: 20px; 
    line-height: 1.2;
}

.brand-text p {
    font-size: 11px;
    color: var(--text-muted);
}

.new-chat { 
    display: flex; 
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%; 
    padding: 12px; 
    background: var(--primary-color); 
    color: white; 
    border: none; 
    border-radius: 8px; 
    margin-bottom: 24px; 
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.new-chat:hover { background: #008f6b; }
.new-chat i { width: 18px; height: 18px; }

.sidebar nav ul { list-style: none; }
.sidebar nav li { 
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px; 
    color: var(--text-main); 
    font-weight: 500;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: background 0.2s;
}

.sidebar nav li i { width: 18px; height: 18px; color: var(--text-muted); }

.sidebar nav li:hover { background: #f3f4f6; }
.sidebar nav li.active { 
    background: var(--primary-light); 
    color: var(--primary-color); 
}
.sidebar nav li.active i { color: var(--primary-color); }

/* Main Area */
.main-area { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    position: relative;
    background: #fdfdfd;
}

.top-bar {
    display: flex;
    justify-content: flex-end;
    padding: 20px 40px;
}

.clear-chat {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.clear-chat i { width: 16px; height: 16px; }
.clear-chat:hover { background: #f9fafb; }

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 40px 100px 40px;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.upload-section-container {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.upload-box { 
    flex: 1;
    background: white; 
    padding: 30px; 
    border: 2px dashed #a7f3d0; 
    border-radius: 12px; 
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 300px;
}

.upload-icon {
    width: 40px;
    height: 40px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.upload-box h2 { 
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px; 
}

.upload-box p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.hidden-input { display: none; }

.upload-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.upload-btn i { width: 16px; height: 16px; }
.upload-btn:hover { background: #008f6b; }

.file-preview { 
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px; 
    border: 1px solid var(--border-color); 
    background: white; 
    border-radius: 12px; 
    min-width: 300px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.file-icon {
    background: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 12px;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-name {
    font-weight: 600;
    font-size: 14px;
}

.file-size {
    font-size: 12px;
    color: var(--text-muted);
}

.success-icon {
    color: var(--primary-color);
    width: 24px;
    height: 24px;
}

.hidden { display: none !important; }

/* Messages */
.messages { 
    display: flex; 
    flex-direction: column; 
    gap: 24px; 
}

.message-wrapper {
    display: flex;
    gap: 16px;
    max-width: 80%;
}

.message-wrapper.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-wrapper.bot {
    align-self: flex-start;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar.bot {
    background: var(--primary-color);
    color: white;
}

.avatar.bot i { width: 20px; height: 20px; }

.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message { 
    padding: 16px 20px; 
    border-radius: 16px; 
    font-size: 14px;
    line-height: 1.5;
}

.message.user { 
    background: var(--primary-light); 
    border-bottom-right-radius: 4px;
    color: #111;
}

.message.bot { 
    background: white; 
    border: 1px solid var(--border-color); 
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    align-self: flex-end;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.message-time i { width: 12px; height: 12px; color: var(--primary-color); }

/* Input Area */
.input-area-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 40px;
    background: linear-gradient(transparent, white 40%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chat-input-container {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 8px 16px;
    width: 100%;
    max-width: 760px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.chat-input-container input[type="text"] { 
    flex: 1; 
    padding: 12px; 
    border: none; 
    outline: none;
    font-size: 15px;
    background: transparent;
}

.chat-input-container input::placeholder {
    color: #9ca3af;
}

.chat-input-container button { 
    width: 40px;
    height: 40px;
    background: var(--primary-color); 
    color: white; 
    border: none; 
    border-radius: 50%; 
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.chat-input-container button i { width: 18px; height: 18px; }
.chat-input-container button:hover { transform: scale(1.05); }

.disclaimer {
    margin-top: 12px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

/* Reports View */
.reports-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 40px 40px 40px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.reports-header {
    margin-bottom: 30px;
}

.reports-header h2 {
    font-size: 24px;
    color: var(--text-main);
    margin-bottom: 8px;
}

.reports-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.reports-content {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.no-report {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
}

.empty-icon {
    width: 48px;
    height: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.report-section {
    margin-bottom: 24px;
}

.report-section:last-child {
    margin-bottom: 0;
}

.report-section h3 {
    font-size: 16px;
    color: var(--primary-color);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-section h3 i { width: 18px; height: 18px; }

.report-section ul {
    list-style-type: disc;
    margin-left: 20px;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.6;
}

.report-section li { margin-bottom: 6px; }

.report-summary-box {
    background: var(--primary-light);
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
}

/* History View */
.history-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 40px 40px 40px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.history-item {
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item:hover {
    background: #f8fafc;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.history-item-details h4 {
    font-size: 16px;
    color: var(--text-main);
    margin-bottom: 4px;
}

.history-item-details p {
    font-size: 13px;
    color: var(--text-muted);
}

.history-item i {
    color: var(--text-muted);
}

.history-item:hover i {
    color: var(--primary-color);
}

.history-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-delete-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

.history-delete-btn i {
    width: 16px;
    height: 16px;
}

.history-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.clear-all-history-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 1px solid #fca5a5;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-all-history-btn:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.clear-all-history-btn i {
    width: 14px;
    height: 14px;
}
