/* =========================================================
   LUXURIA IA - Luxury Monochromatic Dark Theme
   ========================================================= */

:root {
  --bg-main: #0a0b10;
  --bg-sidebar: #0e1017;
  --bg-card: #141721;
  --bg-input: #161926;
  --bg-hover: #1f2333;
  --bg-message-user: #1e2438;
  --bg-message-ai: #11141e;
  
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;
  --border-subtle: rgba(255, 255, 255, 0.05);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;
  
  --accent: #ffffff;
  --accent-cyan: #38bdf8;
  --accent-gold: #f59e0b;
  --danger: #f43f5e;
  --success: #10b981;
  --warning: #f59e0b;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px rgba(56, 189, 248, 0.15);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 10% 20%, rgba(30, 41, 59, 0.25) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(15, 23, 42, 0.35) 0%, transparent 40%),
              #0a0b10;
  color: var(--text-main);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  overflow: hidden;
  letter-spacing: -0.01em;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-sub);
}

/* App Container */
#app {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* =========================================================
   AUTH CONTAINER (Login / Register / Forgot)
   ========================================================= */
.auth-wrapper {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #171722 0%, #09090b 80%);
  padding: 16px;
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.3s ease-out;
}

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

.auth-brand .logo-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
}

.auth-brand h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
}

.auth-brand p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 9px 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--bg-hover);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--border-focus);
}

.form-actions {
  margin-top: 24px;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #000000;
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-primary:active {
  transform: scale(0.99);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-footer {
  text-align: center;
  margin-top: 18px;
}

.auth-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.auth-link:hover {
  color: var(--accent);
}

.auth-notice {
  font-size: 12px;
  color: var(--text-sub);
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-top: 20px;
  line-height: 1.4;
}

.alert-msg {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.alert-msg.error {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.alert-msg.success {
  display: block;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* =========================================================
   APP LAYOUT (Sidebar & Main Chat)
   ========================================================= */
.sidebar {
  width: 270px;
  height: 100%;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-wrapper svg {
  width: 26px;
  height: 26px;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent);
}

.btn-new-chat {
  margin: 12px 14px;
  padding: 10px 14px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-new-chat:hover {
  background: #2a2a36;
  border-color: var(--border-focus);
}

.sidebar-chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.chat-item:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.chat-item.active {
  background: var(--bg-card);
  color: var(--accent);
  border: 1px solid var(--border);
}

.chat-item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.chat-item-actions {
  display: none;
  gap: 6px;
  margin-left: 8px;
}

.chat-item:hover .chat-item-actions,
.chat-item.active .chat-item-actions {
  display: flex;
}

.chat-item-action-btn {
  background: none;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  border-radius: 4px;
}

.chat-item-action-btn:hover {
  color: var(--text-main);
}

.chat-item-action-btn.del:hover {
  color: var(--danger);
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-sidebar);
}

.user-profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
  flex-shrink: 0;
}

.user-meta {
  overflow: hidden;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  display: inline-block;
}
.badge-admin {
  background: rgba(229, 193, 88, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(229, 193, 88, 0.3);
}
.badge-user {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

/* =========================================================
   MAIN CHAT CONTAINER
   ========================================================= */
.main-content {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-main);
  overflow: hidden;
}

/* Top Navigation Bar */
.chat-navbar {
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(14, 16, 23, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 20;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-toggle-sidebar {
  display: none;
}

.model-selector-wrapper {
  position: relative;
}

.model-select {
  background: rgba(20, 23, 33, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 32px 7px 12px;
  cursor: pointer;
  outline: none;
  appearance: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.model-select:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(31, 35, 51, 0.85);
}

.model-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.model-selector-wrapper::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--text-muted);
  pointer-events: none;
}

/* Status Banner (e.g. Account Pending) */
.permission-banner {
  background: rgba(245, 158, 11, 0.12);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  color: #fde68a;
  padding: 8px 16px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

/* Message Scroll Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 140px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}

.welcome-screen {
  margin: auto;
  max-width: 580px;
  text-align: center;
  padding: 40px 16px;
  animation: fadeIn 0.4s ease-out;
}

.welcome-logo {
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
}

.welcome-screen h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 8px;
}

.welcome-screen p {
  color: var(--text-muted);
  font-size: 14.5px;
  margin-bottom: 28px;
}

.welcome-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  text-align: left;
}

.prompt-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.prompt-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-focus);
}

.prompt-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

.prompt-card-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* Messages */
.message-row {
  display: flex;
  gap: 14px;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  animation: messageAppear 0.25s ease-out;
}

.message-row.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
}

.message-avatar.ai {
  background: #000;
  border-color: var(--border);
}

.message-bubble {
  max-width: 82%;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  font-size: 14.5px;
  line-height: 1.65;
  position: relative;
  word-break: break-word;
  box-shadow: var(--shadow-sm);
}

.message-row.user .message-bubble {
  background: linear-gradient(135deg, #1e2438 0%, #161b2e 100%);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  border-bottom-right-radius: 4px;
}

.message-row.assistant .message-bubble {
  background: rgba(17, 20, 30, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
}

/* Agent Server Tools in Chat */
.agent-tool-box {
  background: rgba(14, 16, 23, 0.95);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-left: 3px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 13px;
  animation: fadeIn 0.2s ease-out;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.agent-tool-box.completed {
  border-color: rgba(16, 185, 129, 0.25);
  border-left-color: var(--success);
}
.agent-tool-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tool-badge {
  background: rgba(229, 193, 88, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(229, 193, 88, 0.3);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.tool-badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.3);
}
.tool-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.tool-code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  color: #f4f4f5;
  word-break: break-all;
}
.agent-tool-box details {
  margin-top: 8px;
}
.agent-tool-box summary {
  color: var(--text-sub);
  cursor: pointer;
  font-size: 11.5px;
  user-select: none;
}
.agent-tool-box summary:hover {
  color: var(--text-muted);
}
.agent-tool-output {
  margin-top: 6px;
  max-height: 200px;
  overflow-y: auto;
  background: #000000;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  font-family: monospace;
  font-size: 11.5px;
  color: #a1a1aa;
  white-space: pre-wrap;
}

/* Attached Media in messages */
.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.attachment-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
}

.attachment-image-preview {
  max-width: 280px;
  max-height: 200px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  object-fit: cover;
  display: block;
}

/* Markdown typography inside assistant messages */
.message-bubble p {
  margin-bottom: 12px;
}
.message-bubble p:last-child {
  margin-bottom: 0;
}
.message-bubble h1, .message-bubble h2, .message-bubble h3 {
  margin: 14px 0 8px;
  color: var(--accent);
}
.message-bubble ul, .message-bubble ol {
  margin: 8px 0 12px 20px;
}
.message-bubble li {
  margin-bottom: 4px;
}
.message-bubble code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 13px;
}
.message-bubble pre {
  background: #000000;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  overflow-x: auto;
  margin: 12px 0;
  position: relative;
}
.message-bubble pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.copy-code-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.copy-code-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

/* Cursor indicator while generating */
.typing-cursor::after {
  content: "▋";
  display: inline-block;
  margin-left: 3px;
  color: var(--text-muted);
  animation: blink 0.8s infinite;
}

/* =========================================================
   BOTTOM FLOATING INPUT BAR
   ========================================================= */
.chat-input-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px 24px;
  background: linear-gradient(180deg, rgba(9, 9, 11, 0) 0%, rgba(9, 9, 11, 0.95) 40%, rgba(9, 9, 11, 1) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 30;
}

.chat-input-box {
  width: 100%;
  max-width: 840px;
  background: rgba(20, 23, 33, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-input-box:focus-within {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 12px 45px -8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.15);
}

/* Pending attachments row inside input bar */
.input-attachments-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 0;
}

.preview-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text-main);
}

.preview-pill-remove {
  background: transparent;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.preview-pill-remove:hover {
  color: var(--danger);
}

.chat-input-controls {
  display: flex;
  align-items: flex-end;
  padding: 10px 14px;
  gap: 8px;
}

.chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.4;
  resize: none;
  max-height: 180px;
  outline: none;
  padding: 4px 0;
}

.chat-textarea::placeholder {
  color: var(--text-sub);
}

.btn-attach {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-attach:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.btn-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  color: #0f172a;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

.btn-send:hover:not(:disabled) {
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.35);
}

.btn-send:disabled {
  background: var(--bg-hover);
  color: var(--text-sub);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.input-disclaimer {
  font-size: 11.5px;
  color: var(--text-sub);
  margin-top: 6px;
}

/* =========================================================
   ADMIN MODAL / DIALOGS
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  width: 100%;
  max-width: 760px;
  max-height: 85vh;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-header {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-sub);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  font-size: 11px;
}

.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

/* Modern Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border);
  border-radius: 20px;
  transition: 0.2s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
}

input:checked + .slider {
  background-color: var(--success);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

.btn-table-action {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  cursor: pointer;
}
.btn-table-action:hover {
  background: #2a2a36;
}
.btn-table-action.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Backdrop for Mobile Sidebar */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 45;
}

/* =========================================================
   ANIMATIONS & RESPONSIVE DESIGN
   ========================================================= */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0,0,0,0.6);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop.open {
    display: block;
  }

  .btn-toggle-sidebar {
    display: flex;
  }

  .chat-messages {
    padding: 16px 12px 140px;
  }

  .welcome-cards {
    grid-template-columns: 1fr;
  }

  .message-bubble {
    max-width: 90%;
  }

  .chat-input-wrapper {
    padding: 10px 12px 18px;
  }
}
