/* SaaS Style Reset */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', -apple-system, sans-serif; }
body { background: #f8fafc; color: #1e293b; display: flex; height: 100vh; overflow: hidden; }

/* Layout */
.app-container { display: flex; width: 100%; }
.sidebar { width: 250px; background: #ffffff; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column; }
.sidebar .brand { padding: 20px; font-weight: bold; font-size: 1.2rem; border-bottom: 1px solid #e2e8f0; }
.sidebar nav { display: flex; flex-direction: column; padding: 10px 0; flex-grow: 1; }
.sidebar nav a { padding: 12px 20px; text-decoration: none; color: #475569; transition: background 0.2s; }
.sidebar nav a:hover { background: #f1f5f9; color: #0f172a; }
.main-content { flex-grow: 1; display: flex; flex-direction: column; overflow-y: auto; }
.content-wrapper { padding: 30px; max-width: 1200px; margin: 0 auto; width: 100%; }
.mobile-header { display: none; }

/* Cards & Forms */
.card, .login-card { background: #fff; padding: 25px; border-radius: 12px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.stat { font-size: 2rem; font-weight: bold; color: #3b82f6; margin-top: 10px; }

form input, form textarea, form select { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 6px; margin-bottom: 15px; }
button { background: #3b82f6; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: 600; }
button:hover { background: #2563eb; }
button:disabled { background: #94a3b8; cursor: not-allowed; }

/* Chat specific */
.chat-container { display: flex; gap: 20px; height: 70vh; }
.chat-sidebar { width: 200px; }
.chat-main { flex-grow: 1; display: flex; flex-direction: column; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid #e2e8f0;}
.chat-history { flex-grow: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
.chat-input-area { display: flex; padding: 15px; border-top: 1px solid #e2e8f0; gap: 10px; }
.chat-input-area input { margin-bottom: 0; }
.msg { padding: 10px 15px; border-radius: 8px; max-width: 80%; }
.msg.user { background: #3b82f6; color: white; align-self: flex-end; }
.msg.bot { background: #f1f5f9; color: #1e293b; align-self: flex-start; }

/* Utilities */
.hidden { display: none !important; }
.error-text { color: #ef4444; font-size: 0.9rem; margin-top: 10px; }
.result-area { margin-top: 20px; padding: 20px; background: #fff; border-radius: 12px; }
.img-fluid { max-width: 100%; height: auto; }

/* Login Page Specific */
.login-body { justify-content: center; align-items: center; background: #f1f5f9; }
.login-card { width: 400px; text-align: center; }

@media (max-width: 768px) {
    .sidebar { display: none; position: absolute; height: 100%; z-index: 10; }
    .sidebar.open { display: flex; }
    .mobile-header { display: flex; justify-content: space-between; padding: 15px 20px; background: #fff; border-bottom: 1px solid #e2e8f0; }
    .chat-container { flex-direction: column; }
    .chat-sidebar { width: 100%; }
}