/* ---------- Vazirmatn font ---------- */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/static/fonts/Vazirmatn-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/static/fonts/Vazirmatn-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/static/fonts/Vazirmatn-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/static/fonts/Vazirmatn-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Vazirmatn', Tahoma, "Segoe UI", sans-serif; background: #f0f2f5; height: 100vh; display: flex; }

/* apply Vazirmatn to every element (inputs, buttons, ... don't inherit by default) */
input, button, textarea, select { font-family: inherit; }

/* ---------- Sidebar ---------- */
.sidebar { width: 270px; background: #1f2937; color: #e5e7eb; display: flex; flex-direction: column; }
.sidebar h2 { padding: 16px; font-size: 15px; border-bottom: 1px solid #374151; }
.btn-new-chat { margin: 12px 16px; padding: 10px; background: #2563eb; color: white; border: none; border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 14px; }
.btn-new-chat:hover { background: #1d4ed8; }
.chat-list { flex: 1; overflow-y: auto; padding: 4px 8px; }
.chat-item { padding: 10px; border-radius: 8px; cursor: pointer; font-size: 13px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item:hover { background: #374151; }
.chat-item.active { background: #2563eb; color: white; }
.upload-box { padding: 14px; border-top: 1px solid #374151; }
.upload-box label { display: block; font-size: 12px; margin-bottom: 6px; color: #9ca3af; }
.upload-status { font-size: 12px; margin-top: 8px; color: #6ee7b7; min-height: 16px; }

/* ---------- Main ---------- */
.main { flex: 1; display: flex; flex-direction: column; }
.header { background: white; padding: 14px 24px; border-bottom: 1px solid #e5e7eb; font-size: 16px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
.doc-badge { font-size: 12px; font-weight: normal; padding: 4px 10px; border-radius: 20px; }
.doc-badge.on  { background: #d1fae5; color: #065f46; }
.doc-badge.off { background: #fee2e2; color: #991b1b; }
.messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 75%; padding: 12px 16px; border-radius: 14px; line-height: 1.8; white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
.msg.user { align-self: flex-end; background: #2563eb; color: white; }
.msg.assistant { align-self: flex-start; background: white; border: 1px solid #e5e7eb; }
.source-tag { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 10px; margin-bottom: 6px; }
.source-tag.document { background: #d1fae5; color: #065f46; }
.source-tag.general { background: #e0e7ff; color: #3730a3; }
.composer { display: flex; gap: 10px; padding: 16px 24px; background: white; border-top: 1px solid #e5e7eb; }
.composer input { flex: 1; padding: 12px 16px; border: 1px solid #d1d5db; border-radius: 10px; font-family: inherit; font-size: 14px; outline: none; }
.composer button { padding: 12px 28px; background: #2563eb; color: white; border: none; border-radius: 10px; cursor: pointer; font-family: inherit; font-size: 14px; }
.composer button:disabled { background: #93c5fd; cursor: not-allowed; }
