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

:root {
  --green: #02ca81;
  --green-hover: #02b574;
  --orange: #fb7f4a;
  --dark: #0F172A;
  --bg: #f3f4f6;
  --white: #FFFFFF;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --sidebar-width: 300px;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--dark);
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', sans-serif;
}

/* ---- Layout ---- */
.app-container {
  display: flex;
  height: 100vh;
  width: 100%;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 100;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--gray-200);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-title {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
}

.btn-new-chat {
  width: 100%;
  padding: 10px 16px;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-new-chat:hover {
  background: var(--green-hover);
}

.btn-new-chat svg {
  width: 16px;
  height: 16px;
}

/* ---- Cases List (flat, like Claude sidebar) ---- */
.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.cases-heading {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  padding: 8px 12px 6px;
}

.case-item {
  position: relative;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.case-item:hover {
  background: var(--gray-100);
}

.case-item.active {
  background: var(--gray-200);
}

.case-item-title {
  font-size: 14px;
  font-weight: 400;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.case-item.active .case-item-title {
  font-weight: 500;
}

.case-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 8px;
}

/* Bug fix: Delete X always visible (opacity-based instead of display:none) */
.case-item-delete {
  opacity: 0.4;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 2px;
  font-size: 16px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s, opacity 0.15s;
}

.case-item:hover .case-item-delete {
  opacity: 1;
}

.case-item-delete:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.case-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-open { background: #22c55e; }
.dot-in_progress { background: #3b82f6; }
.dot-pending_specialist { background: #eab308; }
.dot-resolved { background: var(--gray-400); }
.dot-closed { background: var(--gray-400); }

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--gray-500);
  font-size: 14px;
  line-height: 1.5;
}

.cases-loading {
  text-align: center;
  padding: 32px 16px;
  color: var(--gray-400);
  font-size: 13px;
}

/* ---- Anonymous / Login ---- */
.anon-section {
  text-align: center;
  padding: 32px 16px;
}

.anon-section p {
  color: var(--gray-500);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.anon-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.anon-links a {
  display: block;
  padding: 10px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: opacity 0.2s;
}

.anon-links a:hover {
  opacity: 0.85;
}

.link-login {
  background: var(--green);
  color: var(--white);
}

.link-register {
  background: var(--white);
  color: var(--green);
  border: 2px solid var(--green);
}

/* ---- Sidebar Footer ---- */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--gray-200);
}

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

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

.user-details {
  flex: 1;
  min-width: 0;
}

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

.user-role-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: capitalize;
  background: #dbeafe;
  color: #1e40af;
}

.user-role-badge.role-landlord {
  background: #fef3c7;
  color: #92400e;
}

.user-role-badge.role-tenant {
  background: #dcfce7;
  color: #166534;
}

.user-logout {
  font-size: 12px;
  color: var(--gray-400);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}

.user-logout:hover {
  color: var(--orange);
}

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

.main-header {
  padding: 12px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

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

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--dark);
}

.hamburger svg {
  width: 24px;
  height: 24px;
}

.main-title {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
}

.welcome-text {
  font-size: 14px;
  color: var(--gray-500);
}

/* ---- Chat Area ---- */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message {
  display: flex;
  gap: 10px;
  max-width: 80%;
  min-width: 0;
}

.chat-message.bot {
  align-self: flex-start;
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.bot .msg-avatar {
  background: var(--green);
  color: var(--white);
}

.user .msg-avatar {
  background: var(--dark);
  color: var(--white);
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
  overflow-x: hidden;
}

.bot .msg-bubble {
  background: var(--gray-100);
  color: var(--dark);
  border-bottom-left-radius: 4px;
}

.user .msg-bubble {
  background: var(--green);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.msg-bubble p { margin-bottom: 8px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble ul, .msg-bubble ol { margin: 4px 0 8px 16px; padding-left: 0; }
.msg-bubble strong { font-weight: 600; }
.msg-bubble a { color: inherit; text-decoration: underline; }

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  align-items: center;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-400);
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ---- File Preview ---- */
.chat-files-preview {
  padding: 8px 20px 0;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-files-preview:empty {
  display: none;
  padding: 0;
  border: none;
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--gray-100);
  border-radius: 8px;
  font-size: 12px;
  color: var(--gray-600);
  max-width: 200px;
}

.file-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 0;
  line-height: 1;
  font-size: 16px;
}

.file-chip-remove:hover {
  color: var(--orange);
}

/* ---- Drag & Drop Overlay ---- */
.chat-drop-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(2, 202, 129, 0.08);
  border: 3px dashed var(--green);
  border-radius: 12px;
  z-index: 10;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.chat-drop-overlay.visible {
  display: flex;
}

.chat-drop-label {
  background: var(--white);
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--green);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ---- Chat Input ---- */
.chat-input-bar {
  padding: 12px 20px;
  background: var(--white);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-attach-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  background: var(--white);
  color: var(--gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

.chat-attach-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

.chat-attach-btn svg {
  width: 20px;
  height: 20px;
}

.chat-input-bar textarea {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.4;
  resize: none;
  min-height: 42px;
  max-height: 120px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input-bar textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(2, 202, 129, 0.2);
}

.chat-input-bar textarea::placeholder {
  color: var(--gray-400);
}

.chat-send-btn {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: var(--green);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: var(--green-hover);
}

.chat-send-btn:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
}

.chat-send-btn svg {
  width: 20px;
  height: 20px;
}

.disclaimer {
  padding: 8px 20px;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  text-align: center;
  font-size: 11px;
  color: var(--gray-400);
  line-height: 1.4;
}

/* ---- Mobile Overlay ---- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
}

.developed-by {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ---- Dark Mode ---- */
body.dark-mode { --bg: #1a1a2e; --white: #16213e; --dark: #e2e8f0; --gray-100: #1e293b; --gray-200: #334155; --gray-300: #475569; --gray-400: #94a3b8; --gray-500: #cbd5e1; --gray-600: #e2e8f0; }
body.dark-mode .msg-bubble { color: #e2e8f0; }
body.dark-mode .bot .msg-bubble { background: #1e293b; }
body.dark-mode .chat-input-bar textarea { background: #1e293b; color: #e2e8f0; border-color: #475569; }
body.dark-mode .sidebar { background: #16213e; border-color: #334155; }
body.dark-mode .case-item:hover { background: #1e293b; }
body.dark-mode .case-item.active { background: #334155; }
body.dark-mode .case-item-delete { color: #cbd5e1; opacity: 0.6; }
body.dark-mode .case-item:hover .case-item-delete { opacity: 1; }
body.dark-mode .case-item-delete:hover { color: #f87171; background: rgba(239, 68, 68, 0.2); }
body.dark-mode .main-header { background: #16213e; border-color: #334155; }
body.dark-mode .chat-input-bar { background: #16213e; }
body.dark-mode .disclaimer { background: #16213e; border-color: #334155; }

/* ---- Dark Mode Toggle Button ---- */
.dark-mode-toggle {
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark);
  transition: border-color 0.2s, color 0.2s;
}

.dark-mode-toggle:hover {
  border-color: var(--green);
  color: var(--green);
}

.main-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- Quick Action Chips ---- */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 8px 42px;
}

.quick-actions.hidden {
  display: none;
}

.quick-action-chip {
  padding: 8px 16px;
  border: 1.5px solid var(--green);
  color: var(--green);
  background: var(--white);
  border-radius: 9999px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.quick-action-chip:hover {
  background: var(--green);
  color: #fff;
}

/* ---- Toast Notification ---- */
.randy-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #27ae60;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.randy-toast.toast-success { background: #27ae60; }
.randy-toast.toast-error { background: #e74c3c; }
.randy-toast.visible {
  opacity: 1;
  pointer-events: auto;
}


/* ---- Sidebar Documents Section (above FAQ) ---- */
.sidebar-docs-bottom {
  border-top: 1px solid var(--gray-200);
  padding: 8px 16px;
  display: flex;
  gap: 8px;
}
.docs-btn {
  flex: 1;
  padding: 10px 0;
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  transition: background 0.15s, color 0.15s;
}
.docs-btn:hover {
  background: var(--gray-100);
  color: var(--green);
}
body.dark-mode .sidebar-docs-bottom { border-color: #334155; }
body.dark-mode .docs-btn { border-color: #334155; color: #94a3b8; }
body.dark-mode .docs-btn:hover { background: #1e293b; color: var(--green); }

/* ---- Sidebar FAQ Bottom (expands upward) ---- */
.sidebar-faq-bottom {
  border-top: 1px solid var(--gray-200);
  padding: 0 16px;
}

.faq-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

.faq-toggle-btn:hover .faq-toggle-label {
  color: var(--green);
}

.faq-toggle-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  transition: color 0.2s;
}

.faq-toggle-chevron {
  font-size: 12px;
  color: var(--gray-400);
  transition: transform 0.2s;
}

.sidebar-faq-bottom.open .faq-toggle-chevron {
  transform: rotate(180deg);
}

.faq-collapse-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.sidebar-faq-bottom.open .faq-collapse-body {
  max-height: 500px;
  overflow-y: auto;
}

.faq-collapse-inner {
  padding-bottom: 8px;
}

/* ---- FAQ Accordion ---- */
.faq-item {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 12px 14px;
  background: none;
  border: none;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.faq-question:hover {
  background: var(--gray-100);
}

.faq-chevron {
  font-size: 12px;
  transition: transform 0.2s;
  flex-shrink: 0;
  color: var(--gray-400);
}

.faq-item.expanded .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 0 14px 12px;
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.5;
}

.faq-item.expanded .faq-answer {
  display: block;
}

/* ---- File Preview Thumbnails ---- */
.file-chip-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ---- Document / Appointment Cards in Chat ---- */
.msg-card {
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  background: var(--white);
}

.msg-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.msg-card-icon.form-icon {
  background: #dbeafe;
  color: #2563eb;
}

.msg-card-icon.calendar-icon {
  background: #dcfce7;
  color: #16a34a;
}

.msg-card-body {
  flex: 1;
  min-width: 0;
}

.msg-card-label {
  font-size: 12px;
  color: var(--gray-400);
  margin-bottom: 2px;
}

.msg-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-card-delete {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--gray-400);
  transition: background 0.15s, color 0.15s;
  margin-left: 4px;
  line-height: 1;
  flex-shrink: 0;
}
.msg-card-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
body.dark-mode .msg-card-delete:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.msg-card-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.msg-card-btn.form-btn {
  background: #2563eb;
  color: #fff;
}

.msg-card-btn.form-btn:hover {
  background: #1d4ed8;
}

.msg-card-btn.calendar-btn {
  background: #16a34a;
  color: #fff;
}

.msg-card-btn.calendar-btn:hover {
  background: #15803d;
}

/* ---- Inline Form Card (in-chat signing) ---- */
.inline-form-wrapper {
  margin: 12px 48px 12px 48px;
  max-width: 600px;
}

.inline-form-card {
  border-radius: 14px;
  border: 2px solid #02ca81;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.inline-form-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  background: #02ca81;
  color: #fff;
}

.inline-form-card-body {
  flex: 1;
  min-width: 0;
}

.inline-form-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 2px;
}

.inline-form-card-sub {
  font-size: 12px;
  color: #64748b;
}

.inline-form-sign-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  background: #02ca81;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.inline-form-sign-btn:hover {
  background: #02b574;
}

.inline-form-sign-btn.signed {
  background: #16a34a;
  cursor: default;
}

.inline-form-embed {
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.inline-form-iframe {
  width: 100%;
  height: 700px;
  border: none;
  border-radius: 0 0 12px 12px;
  background: #fff;
}

.inline-form-close-btn {
  display: block;
  width: 100%;
  padding: 8px;
  border: none;
  background: var(--gray-100);
  color: var(--gray-400);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
}

.inline-form-close-btn:hover {
  background: var(--gray-200);
  color: var(--dark);
}

/* Dark mode — inline form card */
body.dark-mode .inline-form-card {
  background: linear-gradient(135deg, #1e293b 0%, #064e3b 100%);
  border-color: #02ca81;
}

body.dark-mode .inline-form-card-title {
  color: #e2e8f0;
}

body.dark-mode .inline-form-card-sub {
  color: #94a3b8;
}

body.dark-mode .inline-form-embed {
  border-color: #334155;
}

/* ---- Forms Drawer (replaces chat area) ---- */
.forms-drawer {
  display: none;
  flex-direction: column;
  height: 100%;
  background: var(--white);
}
.forms-drawer.active {
  display: flex;
}
.forms-drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
}
.forms-back-btn {
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 6px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--dark);
  transition: border-color 0.2s, color 0.2s;
}
.forms-back-btn:hover {
  border-color: var(--green);
  color: var(--green);
}
.forms-drawer-title {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
}
.forms-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.forms-loading,
.forms-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--gray-400);
  font-size: 14px;
}
.form-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: capitalize;
}
.form-status.status-draft { background: #f1f5f9; color: #64748b; }
.form-status.status-sent { background: #dbeafe; color: #2563eb; }
.form-status.status-completed { background: #dcfce7; color: #16a34a; }
.form-status.status-signed { background: #dcfce7; color: #16a34a; }
.form-status.status-declined { background: #fee2e2; color: #dc2626; }
.form-status.status-pending { background: #fef3c7; color: #92400e; }
.forms-warning {
  padding: 12px 20px;
  border-top: 1px solid var(--gray-200);
  font-size: 12px;
  color: var(--gray-400);
  line-height: 1.4;
}

/* ---- Dark Mode: Forms Panel ---- */
body.dark-mode .forms-back-btn { border-color: #475569; color: #e2e8f0; }
body.dark-mode .forms-back-btn:hover { border-color: var(--green); color: var(--green); }
body.dark-mode .forms-drawer { background: #16213e; }
body.dark-mode .forms-drawer-header { border-color: #334155; }
body.dark-mode .forms-warning { border-color: #334155; color: #94a3b8; }
body.dark-mode .form-status.status-draft { background: #1e293b; color: #94a3b8; }

/* ---- Embedded DocuSeal Form ---- */
.embedded-form-header {
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
  border-bottom: 1px solid var(--gray-200);
}
docuseal-form {
  display: block;
  width: 100%;
  min-height: 500px;
}
body.dark-mode .embedded-form-header {
  color: #e2e8f0;
  border-color: #334155;
}

/* ---- Attachments Drawer (replaces chat area, same as forms drawer) ---- */
.attachments-drawer {
  display: none;
  flex-direction: column;
  height: 100%;
  background: var(--white);
}
.attachments-drawer.active {
  display: flex;
}
.attachments-drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
}
.attachments-back-btn {
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 6px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--dark);
  transition: border-color 0.2s, color 0.2s;
}
.attachments-back-btn:hover {
  border-color: var(--green);
  color: var(--green);
}
.attachments-drawer-title {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
}
.attachments-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.attachments-loading,
.attachments-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--gray-400);
  font-size: 14px;
}
.attachments-warning {
  padding: 12px 20px;
  border-top: 1px solid var(--gray-200);
  font-size: 12px;
  color: var(--gray-400);
  line-height: 1.4;
}

/* ---- Attachment card icon (orange theme) ---- */
.msg-card-icon.attach-icon {
  background: #fff7ed;
  color: #ea580c;
}

/* ---- Attachment download button (orange theme) ---- */
.msg-card-btn.attach-btn {
  background: #ea580c;
  color: #fff;
}
.msg-card-btn.attach-btn:hover {
  background: #c2410c;
}

/* ---- File size label ---- */
.attach-size {
  font-size: 12px;
  color: var(--gray-400);
}

/* ---- Dark Mode: Attachments Panel ---- */
body.dark-mode .attachments-back-btn { border-color: #475569; color: #e2e8f0; }
body.dark-mode .attachments-back-btn:hover { border-color: var(--green); color: var(--green); }
body.dark-mode .attachments-drawer { background: #16213e; }
body.dark-mode .attachments-drawer-header { border-color: #334155; }
body.dark-mode .attachments-warning { border-color: #334155; color: #94a3b8; }
body.dark-mode .msg-card-icon.attach-icon { background: #431407; color: #fb923c; }

/* ---- Mode Dropdown (Pro Plan — replaces header title for Pro users) ---- */
.mode-dropdown {
  padding: 6px 32px 6px 12px;
  border: 2px solid var(--green);
  border-radius: 10px;
  background: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2302ca81' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.mode-dropdown:hover {
  box-shadow: 0 0 0 3px rgba(2, 202, 129, 0.12);
}
.mode-dropdown:focus {
  box-shadow: 0 0 0 3px rgba(2, 202, 129, 0.2);
}
body.dark-mode .mode-dropdown {
  background-color: #1e293b;
  color: #e2e8f0;
  border-color: var(--green);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2302ca81' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
body.dark-mode .mode-dropdown option {
  background: #1e293b;
  color: #e2e8f0;
}

/* ---- Case Subtitle ---- */
.case-subtitle {
  font-size: 12px;
  color: var(--gray-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* ---- Sidebar Search + Filters (Pro Plan) ---- */
.sidebar-search {
  padding: 6px 12px 4px;
}
.sidebar-search input {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  outline: none;
  background: var(--white);
  color: var(--dark);
  transition: border-color 0.2s;
}
.sidebar-search input:focus {
  border-color: var(--green);
}
.sidebar-search input::placeholder {
  color: var(--gray-400);
}
body.dark-mode .sidebar-search input {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}
body.dark-mode .sidebar-search input:focus {
  border-color: var(--green);
}

.sidebar-filters {
  display: flex;
  gap: 4px;
  padding: 4px 12px 6px;
}
.filter-btn {
  padding: 4px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filter-btn.active {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}
.filter-btn:hover:not(.active) {
  border-color: var(--green);
  color: var(--green);
}
body.dark-mode .filter-btn { border-color: #475569; color: #94a3b8; }
body.dark-mode .filter-btn.active { background: var(--green); color: #fff; border-color: var(--green); }

/* ---- Plans Button ---- */
.plans-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--green);
  border-radius: 8px;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.plans-btn:hover {
  background: var(--green);
  color: #fff;
}
.plans-btn.plans-btn-pro {
  background: linear-gradient(135deg, #02ca81, #059669);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.plans-btn.plans-btn-pro:hover {
  opacity: 0.9;
}
body.dark-mode .plans-btn { border-color: #02ca81; color: #02ca81; }
body.dark-mode .plans-btn:hover { background: #02ca81; color: #16213e; }
body.dark-mode .plans-btn.plans-btn-pro { background: linear-gradient(135deg, #02ca81, #059669); color: #fff; border-color: transparent; }
body.dark-mode .plans-btn.plans-btn-pro:hover { opacity: 0.9; }

/* ---- Settings Button ---- */
.settings-btn {
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark);
  transition: border-color 0.2s, color 0.2s;
}
.settings-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

/* ---- Settings Drawer ---- */
.settings-drawer {
  display: none;
  flex-direction: column;
  height: 100%;
  background: var(--white);
}
.settings-drawer.active {
  display: flex;
}
.settings-drawer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
}
.settings-back-btn {
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 6px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--dark);
  transition: border-color 0.2s, color 0.2s;
}
.settings-back-btn:hover {
  border-color: var(--green);
  color: var(--green);
}
.settings-drawer-title {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
}
.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Settings sections */
.settings-section {
  margin-bottom: 24px;
}
.settings-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  margin-bottom: 10px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}
.settings-label {
  font-size: 14px;
  color: var(--dark);
  font-weight: 500;
}
.settings-value {
  font-size: 14px;
  color: var(--gray-500);
}
.settings-plan-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.settings-plan-badge.plan-free {
  background: var(--gray-100);
  color: var(--gray-500);
}
.settings-plan-badge.plan-pro {
  background: linear-gradient(135deg, #02ca81, #02b574);
  color: #fff;
}

/* Mode selector cards */
.mode-option {
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.mode-option:hover {
  border-color: var(--green);
}
.mode-option.active {
  border-color: var(--green);
  background: rgba(2, 202, 129, 0.05);
}
.mode-option.locked {
  opacity: 0.5;
  cursor: not-allowed;
  position: relative;
}
.mode-option.locked:hover {
  border-color: var(--gray-200);
}
.mode-option-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mode-option-desc {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.4;
}
.mode-lock-hint {
  font-size: 11px;
  color: var(--orange);
  font-weight: 500;
  margin-top: 6px;
}

/* Theme toggle in settings */
.settings-toggle {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  border: none;
  background: var(--gray-300);
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}
.settings-toggle.on {
  background: var(--green);
}
.settings-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.settings-toggle.on::after {
  transform: translateX(20px);
}

/* Dark mode — settings */
body.dark-mode .settings-drawer { background: #16213e; }
body.dark-mode .settings-drawer-header { border-color: #334155; }
body.dark-mode .settings-back-btn { border-color: #475569; color: #e2e8f0; }
body.dark-mode .settings-back-btn:hover { border-color: var(--green); color: var(--green); }
body.dark-mode .settings-plan-badge.plan-free { background: #1e293b; color: #94a3b8; }
body.dark-mode .mode-option { border-color: #334155; }
body.dark-mode .mode-option.active { border-color: var(--green); background: rgba(2, 202, 129, 0.08); }
body.dark-mode .mode-option.locked { opacity: 0.4; }
body.dark-mode .settings-toggle { background: #475569; }

/* ---- Pro Badge ---- */
.user-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pro-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, #02ca81, #059669);
  color: #fff;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

/* ---- Upgrade Card (sidebar footer) ---- */
.upgrade-card {
  margin-bottom: 12px;
}
.upgrade-card-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(2, 202, 129, 0.08) 0%, rgba(5, 150, 105, 0.04) 100%);
  border: 1px solid rgba(2, 202, 129, 0.25);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.upgrade-card-inner:hover {
  background: linear-gradient(135deg, rgba(2, 202, 129, 0.14) 0%, rgba(5, 150, 105, 0.08) 100%);
  border-color: var(--green);
  box-shadow: 0 2px 8px rgba(2, 202, 129, 0.12);
}
.upgrade-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.upgrade-card-text {
  flex: 1;
  min-width: 0;
}
.upgrade-card-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.3;
}
.upgrade-card-desc {
  display: block;
  font-size: 11px;
  color: var(--gray-500);
  line-height: 1.3;
}
.upgrade-card-arrow {
  color: var(--gray-400);
  flex-shrink: 0;
  transition: color 0.2s, transform 0.2s;
}
.upgrade-card-inner:hover .upgrade-card-arrow {
  color: var(--green);
  transform: translateX(2px);
}
body.dark-mode .upgrade-card-inner {
  background: linear-gradient(135deg, rgba(2, 202, 129, 0.06) 0%, rgba(5, 150, 105, 0.03) 100%);
  border-color: rgba(2, 202, 129, 0.2);
}
body.dark-mode .upgrade-card-inner:hover {
  background: linear-gradient(135deg, rgba(2, 202, 129, 0.12) 0%, rgba(5, 150, 105, 0.06) 100%);
  border-color: var(--green);
}
body.dark-mode .upgrade-card-title { color: #e2e8f0; }
body.dark-mode .upgrade-card-desc { color: #94a3b8; }

/* ---- Upgrade Modal (3-tier pricing) ---- */
.upgrade-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  padding: 20px;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.upgrade-modal {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
}
.upgrade-modal.upgrade-modal-wide {
  max-width: 820px;
  width: 95%;
  padding: 32px 28px;
}
.upgrade-modal-x {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.upgrade-modal-x:hover {
  color: var(--dark);
  background: var(--gray-100);
}
.upgrade-modal-title {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
}
.upgrade-modal-desc {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Pricing cards grid */
.pricing-cards {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}
.pricing-card {
  flex: 1;
  border: 2px solid var(--gray-200);
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.2s, transform 0.2s;
}
.pricing-card:hover {
  border-color: var(--gray-300);
}
.pricing-card-featured {
  border-color: var(--green);
  box-shadow: 0 4px 20px rgba(2, 202, 129, 0.15);
  transform: scale(1.03);
}
.pricing-card-featured:hover {
  border-color: var(--green);
}
.pricing-card-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #02ca81, #059669);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.pricing-card-name {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
  margin-top: 4px;
}
.pricing-card-price {
  font-family: 'Poppins', sans-serif;
  font-size: 44px;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.pricing-card-featured .pricing-card-price {
  color: var(--green);
}
.pricing-card-price.pricing-price-custom {
  font-size: 32px;
  color: var(--gray-500);
}
.pricing-card-period {
  font-size: 12px;
  color: var(--gray-400);
  margin-bottom: 12px;
  font-weight: 500;
}
.pricing-card-desc {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.4;
  margin-bottom: 16px;
  min-height: 36px;
}
.pricing-features {
  text-align: left;
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  flex: 1;
}
.pricing-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
  color: var(--dark);
}
.pricing-check {
  color: var(--green);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.pricing-cta-btn {
  width: 100%;
  padding: 11px 20px;
  border: 2px solid transparent;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s, border-color 0.2s;
}
.pricing-cta-basic {
  background: var(--gray-100);
  color: var(--dark);
  border-color: var(--gray-200);
}
.pricing-cta-basic:hover {
  border-color: var(--green);
  color: var(--green);
}
.pricing-cta-pro {
  background: linear-gradient(135deg, #02ca81, #059669);
  color: #fff;
  border-color: transparent;
}
.pricing-cta-pro:hover {
  opacity: 0.9;
}
.pricing-cta-corp {
  background: transparent;
  color: var(--dark);
  border-color: var(--gray-300);
}
.pricing-cta-corp:hover {
  border-color: var(--dark);
}
/* ---- Trust Bar (compact, in-modal) ---- */
.trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 0 6px;
  flex-wrap: wrap;
}
.trust-bar-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
}
.trust-bar-item svg {
  color: var(--green);
  flex-shrink: 0;
}
.trust-bar-sep {
  color: var(--gray-300);
  font-size: 12px;
}
.trust-bar-link {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
}
.trust-bar-link:hover {
  text-decoration: underline;
}
body.dark-mode .trust-bar-sep { color: #475569; }

/* ---- Forms Dropdown in Pricing ---- */
.pricing-feature-dropdown {
  display: block;
}
.pricing-forms-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 0;
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--dark);
  cursor: pointer;
  text-align: left;
}
.pricing-forms-toggle:hover {
  color: var(--green);
}
.pricing-forms-chevron {
  font-size: 10px;
  color: var(--gray-400);
  margin-left: auto;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.pricing-forms-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.pricing-forms-list.open {
  max-height: 400px;
  overflow-y: auto;
}
.pricing-forms-list li {
  padding: 3px 0 3px 26px;
  font-size: 11px;
  color: var(--gray-500);
  line-height: 1.5;
  border-left: 2px solid var(--gray-200);
  margin-left: 6px;
}
body.dark-mode .pricing-forms-toggle { color: #e2e8f0; }
body.dark-mode .pricing-forms-toggle:hover { color: var(--green); }
body.dark-mode .pricing-forms-list li { border-color: #334155; color: #94a3b8; }

.upgrade-close-btn {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 14px;
  cursor: pointer;
  padding: 6px;
}
.upgrade-close-btn:hover {
  color: var(--dark);
}

/* Dark mode — pricing */
body.dark-mode .upgrade-modal { background: #16213e; }
body.dark-mode .upgrade-modal-x:hover { color: #e2e8f0; background: #1e293b; }
body.dark-mode .pricing-card { border-color: #334155; }
body.dark-mode .pricing-card:hover { border-color: #475569; }
body.dark-mode .pricing-card-featured { border-color: var(--green); box-shadow: 0 4px 20px rgba(2, 202, 129, 0.1); }
body.dark-mode .pricing-card-featured:hover { border-color: var(--green); }
body.dark-mode .pricing-card-price.pricing-price-custom { color: #94a3b8; }
body.dark-mode .pricing-cta-basic { background: #1e293b; color: #e2e8f0; border-color: #475569; }
body.dark-mode .pricing-cta-basic:hover { border-color: var(--green); color: var(--green); }
body.dark-mode .pricing-cta-corp { background: transparent; color: #e2e8f0; border-color: #475569; }
body.dark-mode .pricing-cta-corp:hover { border-color: #e2e8f0; }
body.dark-mode .upgrade-close-btn:hover { color: #e2e8f0; }

/* ---- Trust / Security Section ---- */
.trust-section {
  border-top: 1px solid var(--gray-200);
  margin-top: 20px;
  padding-top: 20px;
  text-align: center;
}
.trust-section-title {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 14px;
}
.trust-badges {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.trust-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 80px;
}
.trust-badge-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(2, 202, 129, 0.08);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
}
.trust-badge-icon svg {
  width: 22px;
  height: 22px;
}
.trust-badge-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  white-space: nowrap;
}
.trust-details {
  text-align: left;
  max-width: 680px;
  margin: 0 auto;
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.6;
}
.trust-details p {
  margin-bottom: 8px;
}
.trust-details p:last-child {
  margin-bottom: 0;
}
.trust-details strong {
  color: var(--dark);
  font-weight: 600;
}
body.dark-mode .trust-section { border-color: #334155; }
body.dark-mode .trust-badge-icon { background: rgba(2, 202, 129, 0.12); }

/* ---- Contact Form (Corporate) ---- */
.upgrade-modal.upgrade-modal-contact {
  max-width: 480px;
}
.contact-form-header {
  margin-bottom: 20px;
}
.contact-form-icon {
  color: var(--green);
  margin-bottom: 8px;
}
.contact-form {
  text-align: left;
}
.contact-field {
  margin-bottom: 14px;
}
.contact-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 5px;
}
.contact-input,
.contact-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--dark);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}
.contact-input:focus,
.contact-textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(2, 202, 129, 0.15);
}
.contact-input::placeholder,
.contact-textarea::placeholder {
  color: var(--gray-400);
}
.contact-textarea {
  resize: vertical;
  min-height: 80px;
}
body.dark-mode .contact-input,
body.dark-mode .contact-textarea {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}
body.dark-mode .contact-input:focus,
body.dark-mode .contact-textarea:focus {
  border-color: var(--green);
}

/* ---- Corporate card subtle accent ---- */
.pricing-card-corp {
  background: linear-gradient(180deg, var(--white) 0%, rgba(2, 202, 129, 0.02) 100%);
}
body.dark-mode .pricing-card-corp {
  background: linear-gradient(180deg, #16213e 0%, rgba(2, 202, 129, 0.04) 100%);
}

/* Pricing responsive — stack on mobile */
@media (max-width: 640px) {
  .pricing-cards {
    flex-direction: column;
    gap: 12px;
  }
  .pricing-card-featured {
    transform: none;
    order: -1;
  }
  .upgrade-modal.upgrade-modal-wide {
    padding: 24px 16px;
    max-height: 90vh;
    overflow-y: auto;
  }
  .pricing-card-desc {
    min-height: auto;
  }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
  }

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

  .sidebar-overlay.visible {
    display: block;
  }

  .hamburger {
    display: block;
  }

  .main-content {
    width: 100%;
  }

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

  .mode-dropdown {
    display: none !important;
  }
  .main-title {
    display: inline !important;
  }

  .welcome-text {
    display: none;
  }

}
