/* ═══════════════════════════════════════
   THEME TOKENS
═══════════════════════════════════════ */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface2: #f0f2f9;
  --surface3: #e6e9f5;
  --border: #dde1f0;
  --accent: #4361ee;
  --accent-soft: rgba(67, 97, 238, 0.1);
  --accent-h: #3451d1;
  --text: #1a1d2e;
  --text-muted: #6b7280;
  --text-faint: #a0a8c0;
  --user-bg: #4361ee;
  --user-text: #ffffff;
  --bot-bg: #ffffff;
  --bot-border: #dde1f0;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  --bg: #0d0f18;
  --surface: #151825;
  --surface2: #1e2133;
  --surface3: #252a40;
  --border: #2c3050;
  --accent: #5b78f5;
  --accent-soft: rgba(91, 120, 245, 0.15);
  --accent-h: #7088f7;
  --text: #e4e7f5;
  --text-muted: #8a91b0;
  --text-faint: #555d80;
  --user-bg: #5b78f5;
  --user-text: #ffffff;
  --bot-bg: #1e2133;
  --bot-border: #2c3050;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  background: var(--surface);
  color: var(--text);
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  transition:
    background 0.2s,
    color 0.2s;
}

/* ─── WRAPPER ─── */
.chatbot-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
  transition:
    background 0.2s,
    border-color 0.2s;
}

/* ─── HEADER ─── */
header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 24px;
  background: #fafafc;
  /* your desired color */
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  transition:
    background 0.2s,
    border-color 0.2s;
  z-index: 10;
  width: 100%;
}

/* DARK MODE HEADER (keep existing theme) */
[data-theme="dark"] header {
  background: var(--surface);
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.header-info {
  flex: 1;
  min-width: 0;
}

.header-info h5 {
  font-family: "Inter", "Noto Sans", sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
  line-height: 1;
}

.header-info small {
  font-size: 14px;
  color: var(--text-muted);
}

.header-actions {
  flex-wrap: wrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 33px;
  height: 33px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    transform 0.1s;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--surface3);
  color: var(--text);
  transform: scale(1.05);
}

.icon-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: all 0.2s;
  white-space: nowrap;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}

.toggle-track {
  width: 30px;
  height: 18px;
  border-radius: 10px;
  background: var(--border);
  position: relative;
  transition: background 0.2s;
}

[data-theme="dark"] .toggle-track {
  background: var(--accent);
}

.toggle-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .toggle-thumb {
  transform: translateX(11px);
}


.menu-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    vertical-align: middle;
}

.tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface3);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.tool-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.tool-btn svg {
  width: 20px;
  height: 20px;
}

.chart-container {
  width: 100%;
  height: 250px;
  position: relative;
  max-width: 100%;
  overflow: hidden; 
}

.chart-container canvas {
  display: block;
}

#chatArea {
  position: relative;
  z-index: 1;
  overflow-y: auto;
  background: radial-gradient(circle at 20% 20%, rgba(100,150,255,0.15), transparent 40%),
              radial-gradient(circle at 80% 80%, rgba(0,255,200,0.1), transparent 40%);
}



.lang-select {
  border-radius: 8px;
  padding: 5px 30px 5px 8px;
  font-size: 14px;
  line-height: 1.4;  
  height: 28px;       

  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-image: url('./img/arrow-down.svg'); 
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}

[data-theme="dark"] .lang-select {
  background-image: url("./img/Dark_arrow-down.svg");
}

@keyframes pdot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.85);
  }
}

.glass-card {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  border: 1px solid var(--border);
  max-width: 100%;
  overflow-x: auto;
}

.bot-bubble {
  transition: all 0.2s ease;
}

.bot-bubble:hover {
  transform: translateY(-2px);
}

/* ─── OVERLAY PANELS ─── */
.panel-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: none;
  flex-direction: column;
  background: var(--surface);
  animation: panelIn 0.2s ease;
  overflow: hidden;
}

.panel-overlay.open {
  display: flex;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-header h4 {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.panel-body::-webkit-scrollbar {
  width: 4px;
}

.panel-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.card {
  background: var(--surface2);
  padding: 12px;
  border-radius: 10px;
}

/* ── HISTORY ── */
.history-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 14px;
  transition: border-color 0.2s;
}

.history-search:focus-within {
  border-color: var(--accent);
}

.history-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 13px;
  color: var(--text);
}

.history-search input::placeholder {
  color: var(--text-faint);
}

.hist-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 12px 0 7px;
  font-family: "Inter", "Noto Sans", sans-serif;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background 0.15s,
    border-color 0.15s;
  margin-bottom: 4px;
}

.history-item:hover {
  background: var(--surface2);
  border-color: var(--border);
}

.history-item.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.hist-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.history-item.active .hist-icon {
  background: var(--accent-soft);
}

.hist-meta {
  flex: 1;
  min-width: 0;
}

.hist-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hist-date {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 1px;
  font-family: "Inter", "Noto Sans", sans-serif;
}

.hist-del {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 5px;
  opacity: 0;
  transition:
    opacity 0.15s,
    color 0.15s;
}

.history-item:hover .hist-del {
  opacity: 1;
}

.hist-del:hover {
  color: #ef4444;
}

.history-empty {
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  padding: 48px 20px;
  line-height: 1.8;
}

.history-empty .emoji {
  font-size: 36px;
  display: block;
  margin-bottom: 10px;
}

.new-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  border: none;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  transition:
    background 0.15s,
    transform 0.1s;
}

.new-chat-btn:hover {
  background: var(--accent-h);
}

.new-chat-btn:active {
  transform: scale(0.98);
}

/* ── SETTINGS ── */
.settings-section {
  margin-bottom: 24px;
}

.settings-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 9px;
  font-family: "Inter", "Noto Sans", sans-serif;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  background: var(--surface2);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.profile-avatar {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.avatar-info h6 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.avatar-info span {
  font-size: 12px;
  color: var(--text-muted);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  background: var(--surface2);
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 6px;
  gap: 12px;
}

.setting-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.setting-emoji {
  font-size: 15px;
}

.setting-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.setting-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.sw {
  width: 36px;
  height: 20px;
  border-radius: 12px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  border: none;
  outline: none;
}

.sw.on {
  background: var(--accent);
}

.sw::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.sw.on::after {
  transform: translateX(16px);
}

.setting-select {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 12px;
  color: var(--text);
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
}

.accent-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    transform 0.1s,
    border-color 0.15s;
}

.accent-swatch:hover {
  transform: scale(1.2);
}

.danger-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid #fca5a5;
  background: #fff5f5;
  color: #dc2626;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  margin-bottom: 6px;
  transition: background 0.15s;
}

[data-theme="dark"] .danger-btn {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.3);
}

.danger-btn:hover {
  background: #fee2e2;
}

[data-theme="dark"] .danger-btn:hover {
  background: rgba(220, 38, 38, 0.15);
}

.file-preview {
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 6px;
  width: fit-content;
  overflow-x: auto;
}

.file-preview span {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
}

.file-preview button:hover {
  color: red;
}

.input-area.dragover {
  border: 2px dashed var(--accent);
  background: var(--accent-soft);
}

/* ─── CHAT ─── */
main {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  width: 100%;
}

main::-webkit-scrollbar {
  width: 4px;
}

main::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.welcome-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 10px;
  text-align: center;
  padding: 36px 24px;
  animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.welcome-icon {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow:
    0 0 0 8px var(--accent-soft),
    var(--shadow-md);
  margin-bottom: 8px;
}

.welcome-state h2 {
  font-size: 24px;
  font-weight: 700;
  font-family: "Inter", "Noto Sans", sans-serif;
  color: var(--text);
}

.welcome-state p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 330px;
  line-height: 1.65;
}

.welcome-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  margin-top: 12px;
}

.welcome-chip {
  padding: 6px 13px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.welcome-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Messages */

.bot-row {
  display: flex;
  gap: 9px;
  margin-bottom: 10px;
  align-items: flex-start;
  max-width: 100%;
}

.user-row {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
  /* control spacing here */
}

@keyframes mR {
  from {
    opacity: 0;
    transform: translateX(14px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes mL {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.user-bubble {
  background: var(--user-bg);
  color: var(--user-text);
  padding: 9px 14px;
  border-radius: 17px 4px 17px 17px;
  max-width: 72%;
  font-size: 14px;
  line-height: 1.55;
  box-shadow: 0 2px 10px var(--accent-soft);
  word-break: break-word;
}

.bot-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #e4e7f5, #e6e9f5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.bot-bubble {
  background: var(--bot-bg);
  border: 1px solid var(--bot-border);
  padding: 10px 14px;
  border-radius: 6px 16px 16px 16px;
  max-width: min(100%, 600px);
  width: fit-content;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  word-break: break-word;
}

.file-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 11px;
  margin-bottom: 5px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-time {
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 3px;
  font-family: "Inter", "Noto Sans", sans-serif;
  text-align: right;
}

.bot-row .msg-time {
  text-align: left;
  padding-left: 41px;
}

/* Typing */
.typing-row {
  display: flex;
  gap: 9px;
  margin-bottom: 10px;
  align-items: flex-start;
  animation: mL 0.22s ease;
}

.typing-bubble {
  background: var(--bot-bg);
  border: 1px solid var(--bot-border);
  padding: 11px 15px;
  border-radius: 4px 17px 17px 17px;
  display: flex;
  gap: 5px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  animation: td 1.2s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes td {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* ─── FOOTER ─── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 11px 24px 13px;
  flex-shrink: 0;
  transition:
    background 0.2s,
    border-color 0.2s;
  width: 100%;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  padding: 5px 0px 15px 0px;
}

/* optional: hide scrollbar */
.quick-actions::-webkit-scrollbar {
  display: none;
}

.qa-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qa-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.qa-btn .qi {
  font-size: 12px;
  flex-shrink: 0;
}

/* Input */
.input-area {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 13px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.input-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 14px;
  color: var(--text);
}

.input-box input::placeholder {
  color: var(--text-faint);
}

.attach-label {
  cursor: pointer;
  font-size: 25px;
  color: var(--text-faint);
  transition: color 0.15s;
  flex-shrink: 0;
  line-height: 1;
}

.attach-label:hover {
  color: var(--text);
}

#fileInput {
  display: none;
}

.send-btn {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 12px var(--accent-soft);
  transition:
    background 0.15s,
    transform 0.1s,
    box-shadow 0.15s;
}

.send-btn:hover {
  background: var(--accent-h);
}

.send-btn:active {
  transform: scale(0.92);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.send-btn svg {
  width: 25px;
  height: 25px;
  fill: white;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 600px) {
  .user-bubble,
  .bot-bubble {
    max-width: 88%;
  }

  .toggle-label {
    display: none;
  }

  .bot-bubble table {
    font-size: 11px;
  }

  .bot-bubble div[style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

.profile-icon {
  font-weight: 600;
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.logo-mark {
  cursor: pointer;
}

.logo-mark:hover {
  transform: scale(1.05);
}


.profile-wrapper {
  position: relative;
}

.profile-dropdown {
  position: absolute;
  top: 45px;
  right: 0;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  display: none;
  flex-direction: column;
  z-index: 100;
  padding: 8px;
}

.profile-dropdown.open {
  display: flex;
}

.profile-header {
  display: flex;
  gap: 10px;
  padding: 8px;
  align-items: center;
}

.profile-header .avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-header .name {
  font-size: 13px;
  font-weight: 600;
}

.profile-header .role {
  font-size: 11px;
  color: var(--text-muted);
}

.menu-item {
  padding: 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.menu-item:hover {
  background: var(--surface2);
}

.logout {
  color: #333333;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* ==============================
   RESPONSIVE SYSTEM (NEW)
============================== */

/* Tablet */
@media (max-width: 1024px) {
  header {
    padding: 10px 16px;
  }

  main {
    padding: 16px;
  }

  footer {
    padding: 10px 16px;
  }
}

/* Mobile */
@media (max-width: 768px) {

  /* HEADER */
  header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-info {
    flex: 100%;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  /* CHAT */
  main {
    padding: 12px;
  }

  .user-bubble,
  .bot-bubble {
    max-width: 95%;
    font-size: 13px;
  }

  /* QUICK ACTIONS */
  .quick-actions {
    gap: 6px;
  }

  .qa-btn {
    font-size: 12px;
    padding: 6px 8px;
  }

  /* INPUT */
  .input-box {
    padding: 8px 10px;
  }

  .send-btn {
    width: 42px;
    height: 42px;
  }

  /* DASHBOARD GRID FIX */
  .bot-bubble div[style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Small Mobile (IMPORTANT) */
@media (max-width: 480px) {

  .header-info h5 {
    font-size: 16px;
  }

  .header-info small {
    font-size: 11px;
  }

  .logo-mark {
    width: 34px;
    height: 34px;
  }

  /* Hide less important UI */
  .theme-toggle span {
    display: none;
  }

  /* Input area stack */
  .input-area {
    flex-direction: row;
    gap: 6px;
  }

  .input-box input {
    font-size: 13px;
  }

  /* Welcome */
  .welcome-state h2 {
    font-size: 18px;
  }

  .welcome-state p {
    font-size: 12px;
  }

  header {
    padding: 10px 12px;
  }

  .header-info h5 {
    font-size: 16px;
  }

  .header-info small {
    font-size: 11px;
  }

  .qa-btn {
    font-size: 11px;
    padding: 6px;
  }

  .send-btn {
    width: 40px;
    height: 40px;
  }

}

.flex-col-sm {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flex-col-lg {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fade-in {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}





