/* =====================================================================
   Enzo Design Fix — Claude.ai fidelity with Dumont teal bg
   ===================================================================== */

:root {
  --bg:        #edf8f7;
  --bg-dark:   #e4f4f3;
  --teal:      #41b8b0;
  --teal-dark: #2a9e96;
  --teal-light: rgba(65,184,176,0.12);
  --navy:      #17355a;
  --navy-light:#1e4575;
  --white:     #ffffff;
  --grey-200:  #e5e7eb;
  --grey-300:  #d1d5db;
  --grey-400:  #9ca3af;
  --grey-500:  #6b7280;
  --grey-600:  #4b5563;
  --grey-700:  #374151;
  --grey-800:  #1f2937;
  --grey-900:  #111827;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --radius:    12px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
  --sidebar-w: 260px;
  --sidebar-collapsed-w: 52px;
  --t: 150ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--grey-900);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.view { display: block; }
.view[hidden], [hidden] { display: none !important; }

button { cursor: pointer; border: none; background: none; font: inherit; }
textarea, input { font: inherit; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

.icon-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--grey-500);
  transition: color var(--t), background var(--t);
  flex-shrink: 0;
}
.icon-btn:hover { color: var(--grey-900); background: rgba(0,0,0,0.05); }

/* =====================================================================
   AUTH
   ===================================================================== */

.auth-view {
  min-height: 100vh;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 48px;
  width: 400px;
  max-width: 100%;
}

.auth-brand { text-align: center; margin-bottom: 8px; }

.auth-logomark {
  width: 52px; height: 52px;
  background: var(--teal);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: var(--white);
  margin: 0 auto 12px;
}

.auth-wordmark { font-family: var(--font-serif); font-size: 24px; color: var(--grey-900); font-weight: normal; }
.auth-tagline  { color: var(--teal); font-size: 13px; margin-top: 2px; }
.auth-subtitle { text-align: center; color: var(--grey-400); font-size: 14px; margin: 16px 0 28px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-size: 13px; font-weight: 500; color: var(--grey-600);
  display: flex; justify-content: space-between; align-items: center;
}

.field-link { font-size: 13px; color: var(--grey-400); font-weight: 400; }
.field-link:hover { color: var(--teal); }

.field-input {
  height: 44px;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--grey-900);
  background: var(--white);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.field-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(65,184,176,0.15); }
textarea.field-input { height: auto; padding: 12px 14px; resize: vertical; }

.hint { font-size: 12px; color: var(--grey-400); font-weight: 400; }
.auth-error { color: #dc2626; font-size: 13px; min-height: 18px; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; border-radius: 8px; font-size: 15px; font-weight: 500;
  padding: 0 20px;
  transition: opacity var(--t), transform var(--t), background var(--t);
  cursor: pointer;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-full { width: 100%; }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-light); }
.btn-teal { background: var(--teal); color: var(--white); }
.btn-teal:hover { background: var(--teal-dark); }
.btn-outline { background: transparent; border: 1px solid var(--grey-200); color: var(--grey-600); }
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }
.btn-ghost-sm { background: transparent; color: var(--grey-600); height: 36px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.btn-ghost-sm:hover { background: var(--bg); }

.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--grey-400); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--grey-200); }
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--grey-400); }

/* =====================================================================
   APP LAYOUT
   ===================================================================== */

.app-view { display: flex; height: 100vh; overflow: hidden; }

/* =====================================================================
   SIDEBAR — white, Claude.ai style
   ===================================================================== */

.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid rgba(0,0,0,0.06);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width 200ms ease;
  z-index: 100;
  position: relative;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-w); }

/* Top */
.sidebar-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 12px 10px;
}

.sidebar-wordmark {
  font-family: var(--font-serif);
  font-size: 20px; font-weight: 700;
  color: var(--grey-900);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 150ms;
}
.sidebar.collapsed .sidebar-wordmark { opacity: 0; width: 0; }

.sidebar-collapse-btn { margin-left: auto; }

/* Nav */
.sidebar-nav { padding: 4px 8px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--grey-700);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--t), color var(--t);
  white-space: nowrap; overflow: hidden;
  user-select: none;
}
.nav-item:hover { background: rgba(0,0,0,0.05); }
.nav-item.active { background: rgba(0,0,0,0.08); color: var(--grey-900); font-weight: 500; }

.sidebar.collapsed .nav-item {
  position: relative;
}
.sidebar.collapsed .nav-item:hover::after {
  content: attr(data-label);
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--grey-900); color: var(--white);
  font-size: 12px; white-space: nowrap;
  padding: 5px 10px; border-radius: 6px;
  pointer-events: none; z-index: 200;
  box-shadow: var(--shadow-md);
}

.nav-icon { flex-shrink: 0; color: var(--grey-500); transition: color var(--t); }
.nav-item.active .nav-icon { color: var(--grey-900); }
.nav-item:hover .nav-icon { color: var(--grey-700); }

.nav-label { transition: opacity 150ms; }
.sidebar.collapsed .nav-label { opacity: 0; width: 0; overflow: hidden; }

.nav-divider { height: 1px; background: rgba(0,0,0,0.06); margin: 4px 8px; }

/* Search box */
.sidebar-search-box { padding: 4px 8px 8px; }
.sidebar-search-input {
  width: 100%; height: 34px;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--grey-900);
  background: var(--bg);
  outline: none;
  transition: border-color var(--t);
}
.sidebar-search-input:focus { border-color: var(--teal); }

/* Recents */
.sidebar-recents {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--grey-200) transparent;
}
.sidebar-recents::-webkit-scrollbar { width: 3px; }
.sidebar-recents::-webkit-scrollbar-thumb { background: var(--grey-200); border-radius: 2px; }

.recents-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.07em;
  color: var(--grey-400); text-transform: uppercase;
  padding: 12px 12px 4px;
  white-space: nowrap; overflow: hidden;
  transition: opacity 150ms;
}
.sidebar.collapsed .recents-label { opacity: 0; }

.recents-group-label {
  font-size: 11px; font-weight: 600;
  color: var(--grey-400);
  padding: 8px 12px 2px;
  white-space: nowrap; overflow: hidden;
}
.sidebar.collapsed .recents-group-label { display: none; }

.recents-empty {
  font-size: 13px; color: var(--grey-400);
  padding: 8px 12px;
  transition: opacity 150ms;
}
.sidebar.collapsed .recents-empty { opacity: 0; }

.conv-recent-item {
  display: flex; align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--grey-600);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--t), color var(--t);
  white-space: nowrap; overflow: hidden;
  position: relative;
}
.conv-recent-item:hover { background: rgba(0,0,0,0.04); color: var(--grey-900); }
.conv-recent-item.active { background: rgba(0,0,0,0.07); color: var(--grey-900); font-weight: 500; }
.sidebar.collapsed .conv-recent-item { display: none; }

.conv-recent-title { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.conv-recent-actions {
  display: flex; align-items: center; gap: 2px;
  flex-shrink: 0; opacity: 0;
  transition: opacity var(--t);
}
.conv-recent-item:hover .conv-recent-actions { opacity: 1; }

.conv-recent-del, .conv-recent-rename {
  flex-shrink: 0;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  color: var(--grey-400);
  font-size: 11px;
  transition: background var(--t), color var(--t);
}
.conv-recent-del:hover { background: rgba(220,38,38,0.1); color: #dc2626; }
.conv-recent-rename:hover { background: rgba(0,0,0,0.08); color: var(--grey-700); }

.conv-recent-rename-inp {
  flex: 1; font-size: 13px; color: var(--grey-900);
  border: 1px solid var(--teal); border-radius: 4px;
  padding: 2px 6px; outline: none; background: var(--white);
  min-width: 0;
}

/* Bottom */
.sidebar-bottom {
  border-top: 1px solid rgba(0,0,0,0.06);
  padding: 8px 12px;
  position: relative;
}

.user-popup {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 8px; right: 8px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,0.08);
  overflow: hidden;
  z-index: 200;
  animation: popupIn 120ms ease;
}
@keyframes popupIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.popup-email {
  font-size: 13px; color: var(--grey-400);
  padding: 10px 14px 8px;
}
.popup-divider { height: 1px; background: rgba(0,0,0,0.06); margin: 2px 0; }
.popup-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  font-size: 14px; color: var(--grey-700);
  cursor: pointer;
  transition: background var(--t);
}
.popup-item:hover { background: rgba(0,0,0,0.05); }
.popup-item svg { color: var(--grey-400); flex-shrink: 0; }
.popup-item-muted { color: var(--grey-500); }
.popup-item-danger { color: #dc2626; }
.popup-item-danger svg { color: #dc2626; }
.popup-item-danger:hover { background: rgba(220,38,38,0.06); }

.user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t);
  overflow: hidden;
}
.user-row:hover { background: rgba(0,0,0,0.04); }

.user-avatar {
  width: 34px; height: 34px;
  background: var(--navy); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--white);
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; overflow: hidden; transition: opacity 150ms; }
.sidebar.collapsed .user-info { opacity: 0; width: 0; }

.user-name { font-size: 14px; font-weight: 500; color: var(--grey-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 12px; color: var(--grey-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.user-row-actions { display: flex; gap: 2px; transition: opacity 150ms; }
.sidebar.collapsed .user-row-actions { opacity: 0; }

/* =====================================================================
   MAIN AREA
   ===================================================================== */

.main-area {
  flex: 1;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  position: relative;
}

/* Mobile topbar */
.mobile-topbar {
  display: none; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.hamburger-btn { color: var(--grey-700); }
.mobile-wordmark { font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: var(--grey-900); }

/* Breadcrumb bar */
.breadcrumb-bar {
  height: 48px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: transparent;
  position: relative;
  flex-shrink: 0;
}

.breadcrumb-left { display: flex; align-items: center; gap: 4px; }

.breadcrumb-project-btn {
  font-size: 14px; color: var(--grey-500);
  padding: 4px 6px; border-radius: 6px;
  transition: background var(--t), color var(--t);
}
.breadcrumb-project-btn:hover { background: rgba(0,0,0,0.05); color: var(--grey-900); }

.breadcrumb-sep { font-size: 14px; color: var(--grey-300); padding: 0 2px; }

.breadcrumb-conv-title { font-size: 14px; font-weight: 500; color: var(--grey-700); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.breadcrumb-chevron-btn {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; color: var(--grey-400);
  transition: color var(--t), background var(--t);
}
.breadcrumb-chevron-btn:hover { color: var(--grey-700); background: rgba(0,0,0,0.05); }

.rename-dropdown {
  position: absolute;
  top: calc(100% + 4px); left: 0;
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  z-index: 50;
  min-width: 280px;
  animation: popupIn 120ms ease;
}
.rename-input {
  width: 100%; height: 38px;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--grey-900);
  outline: none;
  background: var(--white);
  transition: border-color var(--t);
}
.rename-input:focus { border-color: var(--teal); }

.breadcrumb-right { display: flex; gap: 4px; align-items: center; }

/* Admin header bar */
.admin-header-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--grey-200);
  flex-shrink: 0;
}
.admin-header-title { font-size: 20px; font-weight: 600; color: var(--grey-900); }
.admin-tabs { display: flex; gap: 4px; }
.tab-btn {
  padding: 6px 16px; border-radius: 6px;
  font-size: 14px; color: var(--grey-600); font-weight: 500;
  transition: background var(--t), color var(--t);
  position: relative;
}
.tab-btn:hover { background: var(--bg); color: var(--grey-900); }
.tab-btn.active { color: var(--teal); }
.tab-btn.active::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
  height: 2px; background: var(--teal); border-radius: 2px 2px 0 0;
}

/* Content area */
.content-area {
  flex: 1;
  overflow-y: auto; overflow-x: hidden;
  position: relative;
}

/* =====================================================================
   PANELS
   ===================================================================== */

.panel { min-height: 100%; }

/* ---- Empty state ---- */
#panel-empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 100%;
  padding: 32px 24px 20px;
}

.empty-center {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  width: 100%; max-width: 720px;
}

.empty-logomark {
  width: 48px; height: 48px;
  background: var(--teal); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: var(--white);
  margin-bottom: 20px;
}

.empty-greeting {
  font-family: var(--font-serif);
  font-size: 32px; font-weight: normal;
  color: var(--grey-900); margin-bottom: 32px;
}

.empty-sub { font-size: 16px; color: var(--grey-400); margin-bottom: 28px; }

.suggestion-pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.pill {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 14px; color: var(--grey-600);
  transition: border-color var(--t), color var(--t);
}
.pill:hover { border-color: var(--teal); color: var(--teal); }

/* ---- Chat panel ---- */
#panel-chat { display: flex; flex-direction: column; }

.messages-scroll {
  flex: 1;
  padding: 24px 20px 100px;
}

/* Message max-width container */
.msgs-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Date separator */
.date-separator { text-align: center; margin: 20px 0 14px; }
.date-separator span {
  display: inline-block;
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 12px; color: var(--grey-400);
}

/* User message — right aligned bubble */
.msg-row { animation: msgFadeIn 200ms ease; }

@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg-row.msg-user {
  display: flex; justify-content: flex-end;
  padding: 4px 0;
}

.msg-user-text {
  background: rgba(65,184,176,0.12);
  border-radius: 18px 18px 4px 18px;
  padding: 10px 16px;
  max-width: 70%;
  font-size: 15px;
  color: #111827;
  line-height: 1.6;
  word-break: break-word;
}

/* Enzo message — left aligned plain text, NO avatar */
.msg-row.msg-enzo {
  display: block;
  padding: 10px 0 6px;
}

.enzo-msg-body { width: 100%; min-width: 0; }

.enzo-msg-text {
  font-size: 15px;
  color: #374151;
  line-height: 1.75;
  word-break: break-word;
}

/* Markdown inside Enzo messages */
.enzo-msg-text p       { margin: 0 0 10px; }
.enzo-msg-text p:last-child { margin-bottom: 0; }
.enzo-msg-text ul,
.enzo-msg-text ol      { margin: 6px 0 10px 20px; }
.enzo-msg-text li      { margin-bottom: 4px; }
.enzo-msg-text strong  { font-weight: 600; color: var(--grey-900); }
.enzo-msg-text em      { font-style: italic; }
.enzo-msg-text h1, .enzo-msg-text h2, .enzo-msg-text h3 {
  margin: 14px 0 6px; font-size: 15px; font-weight: 600; color: var(--grey-900);
}
.enzo-msg-text code {
  font-family: 'Menlo', 'Courier New', monospace;
  font-size: 13px; background: var(--bg-dark); border-radius: 4px; padding: 1px 5px; color: var(--navy);
}
.enzo-msg-text pre {
  background: var(--bg-dark); border-radius: 8px; padding: 14px 16px; margin: 10px 0; overflow-x: auto;
}
.enzo-msg-text pre code { background: none; padding: 0; }
.enzo-msg-text blockquote {
  border-left: 3px solid var(--teal); padding-left: 12px; color: var(--grey-600); margin: 8px 0;
}

/* Fix 2 — explicit .enzo-response markdown rules */
.enzo-response strong { font-weight: 600; color: #111827; }
.enzo-response em { font-style: italic; color: #374151; }
.enzo-response h1, .enzo-response h2, .enzo-response h3 {
  font-weight: 700; margin: 16px 0 8px; color: #111827;
}
.enzo-response ul, .enzo-response ol { padding-left: 20px; margin: 10px 0; }
.enzo-response li { margin: 6px 0; line-height: 1.6; }
.enzo-response p { margin: 0 0 12px; }
.enzo-response p:last-child { margin-bottom: 0; }
.enzo-response code {
  font-family: 'SF Mono', monospace;
  background: rgba(65,184,176,0.1);
  padding: 2px 6px; border-radius: 4px; font-size: 13px;
}
.enzo-response pre {
  background: rgba(65,184,176,0.08);
  padding: 16px; border-radius: 8px;
  overflow-x: auto; margin: 12px 0;
}
.enzo-response a { color: #41b8b0; text-decoration: underline; }
.enzo-response blockquote {
  border-left: 3px solid #41b8b0;
  padding-left: 16px; margin: 12px 0;
  color: #6b7280; font-style: italic;
}

/* Message hover actions */
.msg-hover-actions {
  display: flex; gap: 4px; margin-top: 6px;
  opacity: 0; transition: opacity var(--t);
}
.msg-row:hover .msg-hover-actions { opacity: 1; }
.msg-action-btn {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--grey-400);
  font-size: 13px;
  transition: color var(--t), background var(--t);
}
.msg-action-btn:hover { color: var(--grey-700); background: rgba(0,0,0,0.05); }

.msg-time { font-size: 11px; color: var(--grey-400); margin-top: 4px; }
.msg-user + .msg-time { text-align: right; }

/* Activity indicator (replaces typing dots) */
@keyframes enzo-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.enzo-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(65,184,176,0.2);
  border-top-color: #41b8b0;
  border-radius: 50%;
  animation: enzo-spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.activity-indicator {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0 6px;
  font-size: 13px; color: var(--grey-400);
  animation: msgFadeIn 200ms ease;
}
.activity-text { color: var(--grey-500); }

/* Sources row */
.sources-row {
  font-size: 12px; color: #9ca3af;
  padding: 4px 0 8px;
  display: flex; align-items: center; gap: 6px;
}
.sources-check { color: #41b8b0; font-size: 13px; }

/* ---- Projects panel ---- */
#panel-projects { padding: 0; overflow-y: auto; }
#panel-project-detail { padding: 0; overflow-y: auto; }

.projects-inner { padding: 32px; max-width: 960px; margin: 0 auto; }

.projects-header-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.projects-title {
  font-family: var(--font-serif);
  font-size: 28px; font-weight: 700; color: #111827;
}

.btn-dark {
  background: #111827; color: var(--white);
  border-radius: 8px; padding: 10px 18px;
  font-size: 14px; font-weight: 500;
  transition: background var(--t);
}
.btn-dark:hover { background: #374151; }

.projects-search-wrap {
  position: relative; margin-bottom: 16px;
}
.projects-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: #9ca3af; pointer-events: none;
}
.projects-search-input {
  width: 100%; background: var(--white);
  border: 1px solid rgba(0,0,0,0.12); border-radius: 8px;
  padding: 10px 16px 10px 40px; font-size: 14px; color: #6b7280;
  outline: none; transition: border-color var(--t);
}
.projects-search-input:focus { border-color: var(--teal); color: var(--grey-900); }
.projects-search-input::placeholder { color: #9ca3af; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.project-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 140px;
  cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: box-shadow 150ms ease, border-color 150ms ease, transform 150ms ease;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.project-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.14); transform: translateY(-1px); }

.project-card-top {}
.project-card-name-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.project-card-name-left { display: flex; align-items: center; gap: 7px; }
.project-card-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.project-card-dot.dot-company  { background: var(--teal); }
.project-card-dot.dot-personal { background: #9ca3af; }
.project-card-name { font-size: 16px; font-weight: 600; color: #111827; }

.project-card-menu-btn {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--grey-400); font-size: 18px; line-height: 1;
  opacity: 0; transition: opacity var(--t), background var(--t), color var(--t);
  flex-shrink: 0;
}
.project-card:hover .project-card-menu-btn { opacity: 1; }
.project-card-menu-btn:hover { background: rgba(0,0,0,0.06); color: var(--grey-700); }

.project-card-desc {
  font-size: 14px; color: #6b7280;
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.project-card-footer {
  margin-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 12px;
  font-size: 13px; color: #9ca3af;
}

/* Card context dropdown */
.project-card-dropdown {
  position: absolute; right: 16px; top: 44px;
  background: var(--white); border-radius: 10px;
  box-shadow: var(--shadow-md); min-width: 160px;
  z-index: 100; border: 1px solid rgba(0,0,0,0.08);
  overflow: hidden;
  animation: modalIn 100ms ease;
}
.project-card-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; font-size: 14px; color: var(--grey-700);
  cursor: pointer; transition: background var(--t);
}
.project-card-dropdown-item:hover { background: var(--bg); }
.project-card-dropdown-item.danger { color: #dc2626; }
.project-card-dropdown-item.danger:hover { background: rgba(220,38,38,0.06); }
.project-card-dropdown-divider { height: 1px; background: rgba(0,0,0,0.06); margin: 4px 0; }

.project-card-new {
  border: 2px dashed rgba(0,0,0,0.14);
  background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  font-size: 14px; color: #9ca3af;
  transition: border-color 150ms, color 150ms;
  min-height: 140px;
  box-shadow: none;
}
.project-card-new:hover { border-color: #41b8b0; color: #41b8b0; transform: none; box-shadow: none; }

/* ---- Project detail ---- */
.pd-container { max-width: 1100px; margin: 0 auto; padding: 20px 32px 32px; }

.pd-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: #6b7280; cursor: pointer;
  padding: 4px 0; margin-bottom: 12px;
  transition: color var(--t);
}
.pd-back:hover { color: #111827; }

.pd-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  margin-bottom: 24px;
}
.pd-header-left { display: flex; align-items: center; gap: 10px; }
.pd-header-right { display: flex; align-items: center; gap: 8px; }
.pd-title {
  font-family: var(--font-serif);
  font-size: 26px; font-weight: 700; color: #111827;
}
.pd-star-btn.starred svg { fill: #f59e0b; stroke: #f59e0b; }

.pd-body {
  display: flex; gap: 24px; align-items: flex-start;
}

.pd-left {
  flex: 1; min-width: 0;
  border-right: 1px solid rgba(0,0,0,0.06);
  padding-right: 24px;
}
.pd-right { width: 280px; flex-shrink: 0; }

.pd-convs-header {
  font-size: 13px; font-weight: 600; color: var(--grey-400);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.pd-convs { display: flex; flex-direction: column; }
.pd-conv-item {
  display: flex; align-items: center;
  padding: 14px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.pd-conv-item:last-child { border-bottom: none; }
.pd-conv-item:hover { background: rgba(0,0,0,0.03); }
.pd-conv-main { flex: 1; min-width: 0; }
.pd-conv-title { font-size: 15px; font-weight: 500; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-conv-meta { font-size: 13px; color: #9ca3af; margin-top: 2px; }
.pd-conv-empty { font-size: 14px; color: #9ca3af; padding: 24px 12px; text-align: center; }

.pd-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.pd-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.pd-card-title { font-size: 14px; font-weight: 600; color: #111827; }
.pd-card-body { font-size: 13px; color: #6b7280; line-height: 1.6; white-space: pre-wrap; }
.pd-card-placeholder { color: #9ca3af; font-style: italic; }
.pd-card-textarea {
  width: 100%; min-height: 100px; max-height: 300px;
  border: 1px solid rgba(0,0,0,0.12); border-radius: 8px;
  padding: 10px 12px; font-size: 13px; color: var(--grey-900);
  resize: vertical; outline: none;
  transition: border-color var(--t);
}
.pd-card-textarea:focus { border-color: var(--teal); }
.pd-card-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px;
}
.pd-files-list { display: flex; flex-direction: column; gap: 8px; }
.pd-file-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 13px;
}
.pd-file-name { font-weight: 500; color: #111827; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-file-size { font-size: 11px; color: #9ca3af; flex-shrink: 0; }
.pd-file-badge {
  font-size: 10px; font-weight: 600; color: var(--grey-600);
  background: var(--grey-200); border-radius: 4px; padding: 2px 5px;
  text-transform: uppercase; flex-shrink: 0;
}

/* ---- Knowledge panel ---- */
#panel-knowledge { padding: 32px 20px; }
.knowledge-inner { max-width: 720px; }
.knowledge-heading { font-size: 20px; font-weight: 600; color: var(--grey-900); margin-bottom: 20px; }

.upload-zone {
  border: 2px dashed var(--grey-200); border-radius: var(--radius-lg);
  padding: 48px 32px; text-align: center; background: var(--white);
  cursor: pointer; transition: border-color var(--t), background var(--t);
  margin-bottom: 20px;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--teal); background: var(--teal-light); }
.upload-icon { color: var(--grey-400); margin-bottom: 14px; display: flex; justify-content: center; }
.upload-title { font-size: 16px; color: var(--grey-600); margin-bottom: 6px; }
.upload-link { color: var(--teal); cursor: pointer; }
.upload-hint { font-size: 14px; color: var(--grey-400); }

.knowledge-files-header {
  font-size: 13px; font-weight: 600; color: var(--grey-400);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px;
}

.knowledge-file-card {
  background: var(--white); border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius); padding: 16px;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 8px; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t);
}
.knowledge-file-card:hover { box-shadow: var(--shadow-md); }
.file-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--white); flex-shrink: 0; }
.file-icon-pdf  { background: #e74c3c; }
.file-icon-docx { background: #2980b9; }
.file-icon-txt  { background: var(--grey-400); }
.file-meta { flex: 1; min-width: 0; }
.file-name { font-size: 14px; font-weight: 500; color: var(--grey-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info { font-size: 12px; color: var(--grey-400); margin-top: 2px; }
.file-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.status-badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 100px; text-transform: uppercase; letter-spacing: 0.04em; }
.status-processing { background: var(--teal-light); color: var(--teal-dark); animation: pulse 1.5s ease-in-out infinite; }
.status-ready      { background: rgba(16,185,129,0.12); color: #059669; }
.status-failed     { background: rgba(220,38,38,0.1); color: #dc2626; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.file-delete-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--grey-400); transition: background var(--t), color var(--t); }
.file-delete-btn:hover { background: rgba(220,38,38,0.08); color: #dc2626; }

/* ---- Admin panel ---- */
#panel-admin { padding: 24px; }
.admin-page-title { font-size: 18px; font-weight: 600; color: var(--grey-900); margin-bottom: 16px; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 16px; }
.admin-search { height: 38px; border: 1px solid var(--grey-200); border-radius: 8px; padding: 0 14px; font-size: 14px; background: var(--white); outline: none; width: 240px; transition: border-color var(--t); }
.admin-search:focus { border-color: var(--teal); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.stat-number { font-size: 36px; font-weight: 700; color: var(--navy); line-height: 1; margin-bottom: 6px; }
.stat-label { font-size: 13px; color: var(--grey-400); }
.admin-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 20px; }
.admin-card-title { font-size: 15px; font-weight: 600; color: var(--grey-900); padding: 20px 24px 16px; border-bottom: 1px solid var(--grey-200); }
.usage-chart { padding: 20px 24px 8px; }
.chart-bars { display: flex; gap: 3px; align-items: flex-end; height: 100px; padding-bottom: 4px; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart-bar { width: 100%; background: var(--teal); border-radius: 3px 3px 0 0; min-height: 2px; transition: opacity var(--t); }
.chart-bar-wrap:hover .chart-bar { opacity: 0.7; }
.chart-x-labels { display: flex; gap: 3px; margin-top: 4px; padding-bottom: 8px; }
.chart-label { flex: 1; font-size: 9px; color: var(--grey-400); text-align: center; overflow: hidden; }
.table-loading { padding: 32px; text-align: center; color: var(--grey-400); font-size: 14px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--grey-400); text-transform: uppercase; letter-spacing: 0.06em; padding: 12px 20px; border-bottom: 1px solid var(--grey-200); }
.admin-table td { padding: 12px 20px; color: var(--grey-900); vertical-align: middle; }
.admin-table tr:nth-child(odd) td { background: var(--white); }
.admin-table tr:nth-child(even) td { background: var(--bg); }
.admin-table tr:hover td { background: var(--teal-light); }
.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 100px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-teal   { background: var(--teal-light);             color: var(--teal-dark); }
.badge-navy   { background: rgba(23,53,90,0.12);           color: var(--navy); }
.badge-blue   { background: rgba(59,130,246,0.12);         color: #2563eb; }
.badge-purple { background: rgba(139,92,246,0.12);         color: #7c3aed; }
.badge-green  { background: rgba(16,185,129,0.12);         color: #059669; }
.badge-grey   { background: var(--grey-200);               color: var(--grey-600); }
.badge-red    { background: rgba(220,38,38,0.1);           color: #dc2626; }
.badge-enterprise { background: rgba(23,53,90,0.12); color: var(--navy); }
.badge-pro    { background: var(--teal-light); color: var(--teal-dark); }
.badge-free   { background: var(--grey-200); color: var(--grey-600); }
.activity-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--grey-200); transition: background var(--t); }
.activity-row:last-child { border-bottom: none; }
.activity-row:hover { background: var(--bg); }
.activity-avatar { width: 32px; height: 32px; background: var(--teal); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--white); flex-shrink: 0; }
.activity-body { flex: 1; min-width: 0; }
.activity-name { font-size: 14px; font-weight: 500; color: var(--grey-900); }
.activity-detail { font-size: 13px; color: var(--grey-400); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-time { font-size: 12px; color: var(--grey-400); flex-shrink: 0; margin-top: 2px; }

/* =====================================================================
   INPUT BAR
   ===================================================================== */

.input-bar {
  flex-shrink: 0;
  padding: 12px 20px 20px;
  background: var(--bg);
  position: relative;
}

.plus-menu {
  position: absolute;
  bottom: calc(100% - 8px);
  left: 20px;
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 220px;
  overflow: hidden;
  z-index: 50;
  animation: popupIn 120ms ease;
}

.plus-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  font-size: 14px; color: var(--grey-700);
  cursor: pointer;
  transition: background var(--t);
}
.plus-menu-item:hover { background: rgba(0,0,0,0.05); }
.plus-menu-item svg { color: var(--grey-400); flex-shrink: 0; }
.plus-menu-item-disabled { color: var(--grey-400); cursor: default; }
.plus-menu-item-disabled:hover { background: none; }
.coming-soon-badge { margin-left: auto; font-size: 10px; background: var(--bg-dark); color: var(--grey-400); padding: 2px 6px; border-radius: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.input-card {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 12px 16px;
  max-width: 800px;
  margin: 24px auto 0;
}

.main-textarea {
  width: 100%; border: none; outline: none;
  font-size: 15px; color: var(--grey-900);
  background: transparent; resize: none;
  line-height: 1.5; min-height: 24px; max-height: 200px;
  overflow-y: auto;
  display: block;
}
.main-textarea::placeholder { color: var(--grey-400); }

.input-bottom-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.07);
}

.plus-btn {
  width: 32px; height: 32px;
  background: rgba(0,0,0,0.06);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--grey-500);
  transition: background var(--t), color var(--t);
}
.plus-btn:not(:disabled):hover { background: rgba(0,0,0,0.1); color: var(--grey-900); }
.plus-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.send-btn {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  background: rgba(0,0,0,0.12);
  transition: background var(--t), transform var(--t);
}
.send-btn:not(:disabled) { background: var(--teal); cursor: pointer; }
.send-btn:not(:disabled):hover { background: var(--teal-dark); transform: scale(1.05); }
.send-btn:not(:disabled):active { transform: scale(0.95); }
.send-btn:disabled { cursor: not-allowed; }

/* footer disclaimer is now a fixed global element; .input-disclaimer is removed from input-bar */

.footer-disclaimer {
  position: fixed; bottom: 0; left: 260px; right: 0;
  text-align: center; padding: 8px 24px 12px;
  background: #edf8f7;
  font-size: 12px; color: #9ca3af;
  z-index: 5;
  pointer-events: none;
}
.sidebar.collapsed ~ .main-area .footer-disclaimer {
  left: 52px;
}

/* =====================================================================
   RIGHT PANEL
   ===================================================================== */

.right-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 0;
  background: var(--white);
  border-left: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  transition: width 200ms ease;
  z-index: 40;
  box-shadow: -2px 0 8px rgba(0,0,0,0.04);
}
.right-panel.open { width: 280px; }

.right-panel-inner { width: 280px; height: 100%; display: flex; flex-direction: column; padding: 0; }

.right-panel-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px; border-bottom: 1px solid rgba(0,0,0,0.06);
}
.right-panel-title { font-size: 14px; font-weight: 600; color: var(--grey-900); margin-bottom: 2px; }
.right-panel-sub { font-size: 12px; color: var(--grey-400); }

.right-panel-files { flex: 1; overflow-y: auto; padding: 8px 0; }

.right-panel-file {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 13px;
}
.right-panel-file:last-child { border-bottom: none; }
.right-panel-file .file-name { font-size: 13px; }

.rp-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 16px; text-align: center; color: var(--grey-400);
}
.rp-empty-icon { font-size: 28px; margin-bottom: 10px; opacity: 0.5; }
.rp-empty-title { font-size: 13px; font-weight: 600; color: var(--grey-600); margin-bottom: 4px; }
.rp-empty-sub { font-size: 12px; color: var(--grey-400); line-height: 1.5; }

.rp-file-meta { flex: 1; min-width: 0; }
.rp-file-name { font-size: 13px; font-weight: 500; color: var(--grey-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-file-info { font-size: 11px; color: var(--grey-400); margin-top: 1px; }

.rp-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.rp-status-ready { background: #22c55e; }
.rp-status-processing {
  background: var(--teal);
  animation: rpPulse 1.4s ease-in-out infinite;
}
.rp-status-failed { background: #ef4444; }
@keyframes rpPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.right-panel-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.add-files-btn {
  font-size: 14px; color: var(--teal); cursor: pointer;
  padding: 4px 0;
  transition: text-decoration var(--t);
}
.add-files-btn:hover { text-decoration: underline; }

/* =====================================================================
   MODALS
   ===================================================================== */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 24px;
  animation: backdropIn 150ms ease;
}
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); width: 480px; max-width: 100%;
  animation: modalIn 150ms ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

.modal-settings { width: 560px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 1px solid var(--grey-200); }
.modal-title { font-size: 17px; font-weight: 600; color: var(--grey-900); }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--grey-200); }

.toggle-group { display: flex; gap: 8px; }
.toggle-btn { display: flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1px solid var(--grey-200); border-radius: 8px; font-size: 14px; color: var(--grey-600); transition: border-color var(--t), color var(--t), background var(--t); }
.toggle-btn:hover { border-color: var(--teal); color: var(--teal); }
.toggle-btn.active { border-color: var(--teal); background: var(--teal-light); color: var(--teal-dark); font-weight: 500; }

/* Settings */
.settings-layout { display: flex; min-height: 360px; }
.settings-nav { width: 160px; border-right: 1px solid rgba(0,0,0,0.06); padding: 12px 8px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; }
.settings-nav-item { text-align: left; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--grey-600); transition: background var(--t), color var(--t); }
.settings-nav-item:hover { background: var(--bg); }
.settings-nav-item.active { background: rgba(0,0,0,0.06); color: var(--grey-900); font-weight: 500; }
.settings-body { flex: 1; padding: 20px 24px; overflow-y: auto; }
.settings-section-title { font-size: 13px; font-weight: 600; color: var(--grey-400); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 16px; margin-top: 4px; }
.settings-avatar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.settings-avatar { width: 48px; height: 48px; background: var(--teal); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 600; color: var(--white); }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--grey-200); font-size: 14px; }
.settings-row:last-child { border-bottom: none; }
.settings-row-label { color: var(--grey-600); }
.settings-row-value { color: var(--grey-900); font-weight: 500; }
.settings-row-muted { color: var(--grey-400); font-weight: 400; }

/* =====================================================================
   TOAST
   ===================================================================== */

.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: var(--grey-900); color: var(--white);
  font-size: 14px; padding: 10px 20px; border-radius: 100px;
  box-shadow: var(--shadow-md);
  z-index: 600;
  animation: toastIn 200ms ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* =====================================================================
   SKELETONS
   ===================================================================== */
.skeleton-card { animation: skPulse 1.5s ease-in-out infinite; }
@keyframes skPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.sk-line { height: 14px; background: var(--grey-200); border-radius: 4px; margin-bottom: 10px; }
.w40 { width: 40%; } .w60 { width: 60%; }

/* =====================================================================
   SIDEBAR OVERLAY
   ===================================================================== */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 90; }

/* =====================================================================
   MOBILE
   ===================================================================== */

@media (max-width: 768px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform 200ms ease;
    z-index: 200;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay.visible { display: block; }
  .mobile-topbar { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: 1fr; }
  .input-bar { padding: 8px 12px 16px; }
  .messages-scroll { padding: 16px 12px 12px; }
  .msg-row.msg-user { padding-left: 10%; }
  .auth-card { padding: 32px 20px; }
  .modal { width: calc(100% - 24px); margin: 0 12px; }
  .modal-settings { width: calc(100% - 24px); }
  .settings-layout { flex-direction: column; }
  .settings-nav { width: 100%; border-right: none; border-bottom: 1px solid var(--grey-200); flex-direction: row; flex-wrap: wrap; }
  .admin-header-bar { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 16px; }
  .admin-table { font-size: 13px; }
  .admin-table th, .admin-table td { padding: 10px 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-number { font-size: 28px; }
  .empty-greeting { font-size: 24px; }
  .suggestion-pills { gap: 6px; }
  .pill { font-size: 13px; padding: 7px 12px; }
}
