/* =========================================================
   GLOBAL RESET + VARIABLES
========================================================= */

* {
  box-sizing: border-box;
}

:root {
  --sidebar-width: 340px;
  --sidebar-collapsed-width: 60px;
  --bg-main: #ffffff;
  --bg-sidebar: #f9fafb;
  --bg-assistant: #f3f4f6;
  --bg-user: #f3f4f6;
  --border-light: #e5e7eb;
  --text-main: #111827;
  --text-secondary: #6b7280;
  --radius: 12px;
  --font: system-ui, -apple-system, sans-serif;
  --topbar-height: 80px;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-input: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f3f4f6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font);
  background: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
}

#root {
  height: 100%;
}

/* =========================================================
   MAIN LAYOUT STRUCTURE
========================================================= */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100vw;
  /* Removed overflow: hidden to allow native browser scrolling */
}

/* Header - Fixed at top, spans content area only */
.app-header {
  height: var(--topbar-height);
  width: calc(100% - var(--sidebar-width));
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  z-index: 100;
  overflow: visible;
  transition: left 0.3s ease, width 0.3s ease;
}

.app-header.sidebar-collapsed {
  left: var(--sidebar-collapsed-width);
  width: calc(100% - var(--sidebar-collapsed-width));
}

.header-logo {
  display: none;
}

.header-logo-image {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

.header-logo-text {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  letter-spacing: 0.5px;
  margin-left: -27px;
  font-family: 'Satoshi', 'Helvetica Neue', 'Arial', sans-serif;
}

.header-tabs {
  display: flex;
  gap: 12px;
  align-items: center;
  position: relative;
  height: 100%;
}

.header-tabs::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-light);
}

.header-right {
  display: none;
}

/* App Body - Contains sidebar and content */
.app-body {
  display: flex;
  flex: 1;
  margin-top: var(--topbar-height);
  position: relative;
}

/* Sidebar - Fixed position, full height */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10;
  overflow-y: auto;
  transition: width 0.3s ease, min-width 0.3s ease;
  padding-top: 48px; /* Space for collapse button */
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Content Wrapper - Takes up space next to fixed sidebar */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  position: relative;
  background: var(--bg-main);
  min-width: 0;
  min-height: calc(100vh - var(--topbar-height));
  transition: margin-left 0.3s ease, background 0.3s ease;
}

/* Legacy topbar - now hidden, using app-header instead */
.topbar {
  display: none;
}

/* Container for the pill toggle */
.toggle-container {
  background: #f3f4f6;
  padding: 4px;
  border-radius: 999px; /* Pill shape */
  display: flex;
  gap: 4px;
}

/* Modern Topbar Navigation */
.topbar-btn {
  background: transparent;
  border: none;
  padding: 10px 28px;
  border-radius: 0;
  font-size: 20px;
  font-weight: 400;
  color: #111827;
  cursor: pointer;
  transition: color 0.2s ease;
  height: auto;
  letter-spacing: 0.02em;
  position: relative;
}

/* Active State - color only, no background */
.topbar-btn.active {
  background: transparent;
  font-weight: 700;
  box-shadow: none;
}

/* Individual tab colors when active */
#tabAgent.active {
  color: #D4AF37;
}

#tabChat.active {
  color: #111827;
}

#tabCalendar.active {
  color: #3b82f6;
}

#tabHealth.active {
  color: #ec4899;
}

/* Hover state - subtle color change, no background */
.topbar-btn:hover:not(.active) {
  color: #6b7280;
  background: transparent;
}

#tabAgent:hover:not(.active) {
  color: #D4AF37;
  opacity: 0.7;
}

#tabChat:hover:not(.active) {
  color: #111827;
  opacity: 0.7;
}

#tabCalendar:hover:not(.active) {
  color: #3b82f6;
  opacity: 0.7;
}

#tabHealth:hover:not(.active) {
  color: #ec4899;
  opacity: 0.7;
}

/* Dark mode - Topbar Navigation */
.dark .topbar-btn {
  color: #e5e7eb;
}

.dark #tabAgent.active {
  color: #F5D76E;
}

.dark #tabChat.active {
  color: #f9fafb;
}

.dark #tabCalendar.active {
  color: #60a5fa;
}

.dark #tabHealth.active {
  color: #f472b6;
}

.dark .topbar-btn:hover:not(.active) {
  color: #9ca3af;
}

.dark #tabAgent:hover:not(.active) {
  color: #F5D76E;
  opacity: 0.7;
}

.dark #tabChat:hover:not(.active) {
  color: #f9fafb;
  opacity: 0.7;
}

.dark #tabCalendar:hover:not(.active) {
  color: #60a5fa;
  opacity: 0.7;
}

.dark #tabHealth:hover:not(.active) {
  color: #f472b6;
  opacity: 0.7;
}

/* Dark mode - App Header */
.dark .app-header {
  background: rgba(17, 24, 39, 0.98);
}

.dark .header-tabs::after {
  background: #374151;
}

.dark .header-logo-text {
  color: #f9fafb;
}

.dark .sidebar-collapse-btn {
  color: #9ca3af;
}

.dark .sidebar-collapse-btn:hover {
  background: #374151;
  color: #f9fafb;
}

.dark .sidebar-expand-btn {
  background: #1f2937;
  border-color: #374151;
  color: #9ca3af;
}

.dark .sidebar-expand-btn:hover {
  background: #374151;
  color: #f9fafb;
}

/* Topbar badge for Agent notifications */
.topbar-btn {
  position: relative;
}

.topbar-badge {
  position: absolute;
  top: 2px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #D4AF37;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* =========================================================
   AGENT MODE LAYOUT
========================================================= */

.agent-mode .agent-content {
  margin-left: 0 !important;
  width: 100%;
}

.agent-mode .chat-main {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.agent-mode .messages {
  padding: 20px 40px;
}

.agent-mode .input-box {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 40px 20px;
}

@media (max-width: 768px) {
  .agent-mode .messages,
  .agent-mode .input-box {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Agent Welcome Screen */
.agent-welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  text-align: center;
  padding: 40px;
  color: #6b7280;
}

/* =========================================================
   SCROLLING AREAS (The Fix)
========================================================= */

/* 1. Chat Main: Flex container, NO SCROLL here */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: white;
  min-height: 100vh; /* Allow content to expand beyond viewport */
}

/* Messages: Now flows naturally with browser scrolling */
.messages {
  flex: 1;
  padding: 30px;
  padding-bottom: 200px; /* Extra space for fixed input box at bottom */
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

/* Todo Main can keep simple scrolling */
.todo-main {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
  position: relative;
}

.todo-content-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

/* =========================================================
   CHAT INPUT (Fixed at Bottom)
========================================================= */

.input-box {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width); /* Start after sidebar */
  right: 0;
  /* Gradient fade to look like Gemini */
  background: linear-gradient(to top, #ffffff 85%, rgba(255,255,255,0));
  padding: 20px 30px 40px;
  display: flex;
  flex-direction: column; /* Stack preview above input */
  align-items: center;
  z-index: 20;
  transition: left 0.3s ease;
}

.input-row-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1012px;
  gap: 8px;
}

.input-row {
  flex: 1;
  max-width: 900px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 24px;
  padding: 10px 10px 10px 20px;
  display: flex;
  align-items: flex-end;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: border 0.2s, box-shadow 0.2s;
}

.input-row:focus-within {
  border-color: #9ca3af;
  box-shadow: 0 4px 12px rgba(156, 163, 175, 0.15);
}

#messageInput {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  resize: none;
  font-size: 18px;
  max-height: 150px;
  outline: none;
  line-height: 1.6;
  color: #111827;
  font-family: inherit;
  overflow-y: hidden;
}

#messageInput::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.send-btn {
  width: 40px;
  height: 40px;
  background: #111827;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 10px;
  transition: background 0.2s;
}

.send-btn:hover {
  background: #1f2937;
}

.send-btn.stop-btn {
  background: #111827;
}

.send-btn.stop-btn:hover {
  background: #374151;
}

.send-btn svg {
  fill: white;
  width: 18px;
  height: 18px;
}


/* ============================================
   ATTACH BUTTON
   ============================================ */

.attach-btn {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: #6b7280;
  transition: background 0.2s, color 0.2s;
}

.attach-btn:hover {
  background: #f3f4f6;
  color: var(--primary);
}

.attach-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ============================================
   SHARE CHAT BUTTON
   ============================================ */

.share-chat-btn {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: #6b7280;
  transition: background 0.2s, color 0.2s;
  position: relative;
  margin-left: 16px;
}

.share-chat-btn:hover {
  background: #f3f4f6;
  color: var(--primary);
}

.share-chat-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.share-dropdown {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 8px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 4px 0;
  min-width: 160px;
  z-index: 10000;
  border: 1px solid #e5e7eb;
}

.share-dropdown-item {
  padding: 10px 14px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.share-dropdown-item:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.share-dropdown-item svg {
  flex-shrink: 0;
}

/* ============================================
   FILE PREVIEW CONTAINER (ChatGPT Style)
   ============================================ */

.file-preview-container {
  width: 100%;
  max-width: 900px;
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.file-preview {
  position: relative;
  width: 100px;
  height: 100px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}

.file-preview:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview .file-icon {
  font-size: 40px;
  color: #9ca3af;
}

.file-preview .remove-file-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.75);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
}

.file-preview .remove-file-btn:hover {
  background: #ef4444;
  transform: scale(1.1);
}

.file-preview .file-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 4px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.4));
  color: white;
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   MESSAGE ATTACHMENTS
   ============================================ */

.message-attachment {
  margin-bottom: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  max-width: 400px;
}

.message-attachment img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  transition: opacity 0.2s;
}

.message-attachment img:hover {
  opacity: 0.9;
}

.message-attachment .file-info {
  padding: 8px 12px;
  background: #f9fafb;
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-attachment .file-info svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #6b7280;
}

.message-attachment .file-details {
  flex: 1;
  min-width: 0;
}

.message-attachment .file-details .file-name {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-attachment .file-details .file-size {
  font-size: 12px;
  color: #6b7280;
}

.message-text {
  display: block;
  color: #111827;
  line-height: 1.6;
  font-size: 18px;
}

/* =========================================================
   MESSAGES STYLING
========================================================= */

.message {
  padding: 16px 20px;
  line-height: 1.6;
  font-size: 18px;
  /* Default max-width for User bubbles */
  max-width: 85%;
  animation: fadeIn 0.2s ease-out;
}

/* Assistant: Full width, no background (Gemini Style) */
.message.assistant {
  background: transparent;
  color: #111827;
  max-width: 100%; /* Fixes Issue 1: Aligns to right edge */
  width: 100%;
  padding-left: 0;
  padding-right: 0;
  align-self: flex-start;
}

/* User: Keeps the bubble look */
.message.user {
  align-self: flex-end;
  color: #111827;
  background: transparent;
  padding: 0;
  max-width: none;
  width: auto;
}

.message.user .user-message-content {
  background: var(--bg-user);
  border-radius: 16px 16px 4px 16px;
  padding: 10px 16px;
  display: inline-block;
  max-width: 600px;
}

.message.user .message-text {
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: normal;
}

/* Message Timestamp (for Life Coach) - Legacy */
.message-timestamp {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 6px;
  font-weight: 400;
}

/* Message Date Separator (centered, like mobile app) */
.message-date-separator {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  margin: 16px 0 12px 0;
  padding: 4px 12px;
  font-weight: 500;
}

/* Assistant Content Styling - ChatGPT-like appearance */
.assistant-content h1 {
  font-size: 26px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 16px 0;
  line-height: 1.3;
}

.assistant-content h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin: 24px 0 12px 0;
  line-height: 1.3;
}

.assistant-content h3 {
  font-size: 17px;
  font-weight: 600;
  color: #374151;
  margin: 20px 0 10px 0;
  line-height: 1.3;
}

.assistant-content p {
  margin: 0 0 12px 0;
  line-height: 1.65;
  color: #374151;
}

.assistant-content strong {
  font-weight: 600;
  color: #1f2937;
}

.assistant-content em {
  font-style: italic;
  color: #4b5563;
}

.assistant-content ul,
.assistant-content ol {
  margin: 8px 0 16px 0;
  padding-left: 28px;
}

.assistant-content ul {
  list-style-type: disc;
}

.assistant-content ol {
  list-style-type: decimal;
}

.assistant-content ul li,
.assistant-content ol li {
  margin: 6px 0;
  padding-left: 8px;
  line-height: 1.6;
  color: #374151;
}

.assistant-content code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9em;
  color: #1f2937;
}

.assistant-content a {
  color: #3b82f6;
  text-decoration: underline;
}

.assistant-content a:hover {
  color: #2563eb;
}

.assistant-content hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 24px 0;
}

/* Add to Todo Button: Icon style (Issue 2) */
.add-todo-btn {
  margin-top: 15px;
  background: transparent;
  border: none;
  color: #6b7280; /* Muted gray */
  font-size: 15px;
  font-weight: 500;
  padding: 6px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}

.add-todo-btn:hover {
  color: var(--primary);
  background: transparent;
  text-decoration: underline; /* Optional: adds clarity on hover */
}

.add-todo-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* =========================================================
   SIDEBAR & OTHER UI
========================================================= */

/* Sidebar Logo */
.sidebar-logo {
  padding: 20px 16px 16px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.sidebar-logo h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #000000;
  text-align: left;
}

.logo-image {
  width: 90px;
  height: 90px;
  object-fit: contain;
  display: block;
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  color: #000000;
}

/* Sidebar Action Button (New chat, New event, Daily Health) */
.sidebar-action-btn {
  margin: 0 16px 12px 16px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #1f2937;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
  width: calc(100% - 32px);
}

.sidebar-action-btn:hover {
  background: #e5e7eb;
  color: #111827;
}

.sidebar-action-btn.active {
  background: transparent;
  color: #ec4899;
  font-weight: 600;
}

.sidebar-action-btn.active svg {
  stroke: #ec4899;
  opacity: 1;
}

/* Chat sidebar uses black for active state */
.chat-sidebar .sidebar-action-btn.active {
  background: #f3f4f6;
  color: #111827;
  font-weight: 600;
}

.chat-sidebar .sidebar-action-btn.active svg {
  stroke: #111827;
  opacity: 1;
}

.sidebar-action-btn svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.sidebar-action-btn:hover svg {
  opacity: 1;
}

/* Life Coach button needs relative positioning for badge */
#coachChatBtn {
  position: relative;
}

/* Life Coach Notification Badge */
.coach-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ef4444;
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Primary action button style (New Agent) */
.sidebar-action-btn-primary {
  background: transparent !important;
  color: #1f2937 !important;
}

.sidebar-action-btn-primary:hover {
  background: #e5e7eb !important;
  color: #111827 !important;
}

.sidebar-action-btn-primary svg {
  stroke: #1f2937;
}

/* Section headers in sidebar */
.sidebar-section-header {
  padding: 8px 16px 6px 16px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

/* Navigation item in sidebar */
.sidebar-nav-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  margin: 0 8px 4px 8px;
  border-radius: 8px;
  background: #f9fafb;
  cursor: pointer;
  transition: all 0.2s;
  gap: 10px;
}

.sidebar-nav-item:hover {
  background: #f3f4f6;
}

.sidebar-nav-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-nav-icon svg {
  stroke: #1f2937;
}

.sidebar-nav-content {
  flex: 1;
  min-width: 0;
}

.sidebar-nav-title {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
}

.sidebar-nav-title-large {
  flex: 1;
  font-size: 18px;
  font-weight: 500;
  color: #1f2937;
}

.sidebar-nav-subtitle {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.sidebar-nav-arrow {
  flex-shrink: 0;
  stroke: #9ca3af;
}

/* Agent History - Floating Window */
.agent-history-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.15);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.agent-history-backdrop.visible {
  opacity: 1;
}

.agent-history-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 720px;
  height: 620px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  background: white;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.agent-history-panel.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.agent-history-panel .panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.agent-history-panel .panel-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}

.agent-history-panel .panel-close {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  color: #9ca3af;
}

.agent-history-panel .panel-close:hover {
  background: #f5f5f5;
  color: #666;
}

.agent-history-panel .panel-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.agent-history-panel .panel-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: #f5f5f5;
  border-radius: 16px;
  margin-bottom: 16px;
  height: 36px;
}

.agent-history-panel .panel-search svg {
  stroke: #9ca3af;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.agent-history-panel .panel-search input {
  border: none;
  background: transparent;
  font-size: 16px;
  color: #1a1a1a;
  width: 600px;
  outline: none;
  padding: 0;
  margin: 0;
  height: 100%;
  display: flex;
  align-items: center;
}

.agent-history-panel .panel-search input::placeholder {
  color: #9ca3af;
}

/* Search match highlighting */
.search-highlight {
  background: #fef08a;
  color: #854d0e;
  padding: 1px 2px;
  border-radius: 2px;
  font-weight: 500;
}

.agent-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agent-history-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  gap: 12px;
  border: none;
}

.agent-history-item:hover {
  background: #f5f5f5;
}

.agent-history-item-icon {
  display: none;
}

.agent-history-item-content {
  flex: 1;
  min-width: 0;
}

.agent-history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.agent-history-item-title {
  font-size: 16px;
  font-weight: 500;
  color: #1a1a1a;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-history-item-date {
  font-size: 14px;
  color: #9ca3af;
  flex-shrink: 0;
}

.agent-history-item-preview {
  font-size: 14px;
  color: #888;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.agent-history-item-preview.empty {
  color: #aaa;
  font-style: italic;
}

.agent-history-item-meta {
  display: none;
  color: #6b7280;
}

.agent-history-item-meta svg {
  stroke: #9ca3af;
  width: 14px;
  height: 14px;
}

.agent-history-item-delete {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
  flex-shrink: 0;
  opacity: 0;
  align-self: center;
}

.agent-history-item:hover .agent-history-item-delete {
  opacity: 0.5;
}

.agent-history-item-delete:hover {
  background: #f0f0f0;
  opacity: 1 !important;
}

.agent-history-item-delete svg {
  stroke: #9ca3af;
  width: 16px;
  height: 16px;
}

.agent-history-empty {
  text-align: center;
  padding: 60px 24px;
  color: #9ca3af;
}

.agent-history-empty svg {
  margin-bottom: 12px;
  stroke: #d1d5db;
  width: 40px;
  height: 40px;
}

.agent-history-empty h4 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
}

.agent-history-empty p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

/* Legacy button style - kept for backward compatibility */
.new-chat-btn {
  margin: 16px;
  padding: 12px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-main);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}
.new-chat-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Chat search bar */
.chat-search-container {
  margin: 0 16px 12px 16px;
  position: relative;
  display: flex;
  align-items: center;
}

.chat-search-icon {
  position: absolute;
  left: 12px;
  top: 38%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.chat-search-input {
  width: 100%;
  padding: 10px 36px 10px 36px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 17px;
  outline: none;
  transition: all 0.2s;
  background: white;
}

.chat-search-input:focus {
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.1);
}

.chat-search-input::placeholder {
  color: #9ca3af;
}

.clear-search-btn {
  position: absolute;
  right: 8px;
  top: 38%;
  transform: translateY(-50%);
  background: #e5e7eb;
  border: none;
  padding: 5px;
  cursor: pointer;
  color: #6b7280;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  width: 22px;
  height: 22px;
}

.clear-search-btn:hover {
  background: #d1d5db;
  color: #374151;
}

.clear-search-btn:active {
  transform: scale(0.95);
}

#chatList, #todoMenu {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px;
}

/* Custom scrollbar for chat list and todo menu */
#chatList::-webkit-scrollbar,
#todoMenu::-webkit-scrollbar {
  width: 6px;
}

#chatList::-webkit-scrollbar-track,
#todoMenu::-webkit-scrollbar-track {
  background: transparent;
}

#chatList::-webkit-scrollbar-thumb,
#todoMenu::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

#chatList::-webkit-scrollbar-thumb:hover,
#todoMenu::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.chat-item, .todo-nav-item {
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 17px;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background 0.2s;
}
.chat-item:hover, .todo-nav-item:hover { background: #e5e7eb; }
.chat-item.active, .todo-nav-item.active { background: #e5e7eb; color: #111827; font-weight: 600; }

/* Chat item internal layout */
.chat-info {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-menu-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 4px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #9ca3af;
  opacity: 0;
}

.chat-item:hover .chat-menu-btn {
  opacity: 1;
}

.chat-menu-btn:hover {
  background: #d1d5db;
  color: #4b5563;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

/* User Menu Button */
.user-menu-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.user-menu-btn:hover {
  background: #f3f4f6;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-name {
  flex: 1;
  font-size: 18px;
  font-weight: 500;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* User Dropdown Menu */
.user-dropdown-menu {
  position: fixed;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  min-width: 240px;
  padding: 8px;
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
}

.user-menu-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
}

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

.user-menu-name {
  font-size: 17px;
  font-weight: 600;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-email {
  font-size: 15px;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 0;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  color: #4b5563;
  font-size: 16px;
}

.user-menu-item:hover {
  background: #f3f4f6;
  color: #111827;
}

.user-menu-item svg {
  flex-shrink: 0;
}

.user-menu-item span {
  flex: 1;
}

/* Settings Popup - matches mobile SettingsScreen */
.settings-popup {
  background: #f5f5f5;
  border-radius: 16px;
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}
.settings-popup-sub .settings-popup-body {
  flex: 1;
  overflow-y: auto;
}
.settings-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
}
.settings-popup-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}
.sp-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sp-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #1a1a1a;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
}
.sp-user-name {
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
}
.sp-user-email {
  font-size: 13px;
  color: #9ca3af;
  margin-top: 1px;
}
.settings-popup-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-popup-close:hover {
  background: #e5e7eb;
}
.settings-popup-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 20px;
}
/* Subscription plan cards */
.sub-plans {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sub-plan-card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  border: 2px solid #e5e7eb;
  transition: border-color 0.2s;
}
.sub-plan-card:hover {
  border-color: #c7d2fe;
}
.sub-plan-featured {
  border-color: #818cf8;
  background: linear-gradient(135deg, #faf5ff 0%, #eef2ff 100%);
}
.sub-plan-featured:hover {
  border-color: #6366f1;
}
.sub-plan-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.sub-plan-name {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}
.sub-plan-price {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
  margin-top: 2px;
}
.sub-plan-price span {
  font-size: 15px;
  font-weight: 400;
  color: #6b7280;
}
.sub-plan-badge {
  background: #6366f1;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-top: 4px;
}
.sub-plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}
.sub-plan-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  color: #374151;
}
.sub-plan-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: #1a1a1a;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.sub-plan-btn:hover {
  background: #333;
}
.sub-plan-btn-pro {
  background: #6366f1;
}
.sub-plan-btn-pro:hover {
  background: #4f46e5;
}
.sub-plan-current {
  opacity: 0.7;
  border-color: #d1d5db;
  background: #f9fafb;
}
.sub-plan-current:hover {
  border-color: #d1d5db;
}
.sub-plan-badge-current {
  background: #9ca3af;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-top: 4px;
}
.sub-plan-btn-disabled {
  background: #d1d5db;
  color: #6b7280;
  cursor: default;
}
.sub-plan-btn-disabled:hover {
  background: #d1d5db;
}
.mgn-pending-note {
  margin-top: 8px;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 13px;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.mgn-pending-cancel {
  color: #2563eb;
  cursor: pointer;
  font-weight: 500;
  margin-left: auto;
}
.mgn-pending-cancel:hover {
  text-decoration: underline;
}

.sub-manage-text {
  text-align: center;
  padding: 16px 0 4px;
  font-size: 14px;
  color: #3b82f6;
  cursor: pointer;
  font-weight: 500;
}
.sub-manage-text:hover {
  color: #2563eb;
  text-decoration: underline;
}
.sub-cancel-text {
  text-align: center;
  padding: 16px 0 4px;
  font-size: 14px;
  color: #9ca3af;
  cursor: pointer;
}
.sub-cancel-text:hover {
  color: #ef4444;
}
.sub-cancel-modal {
  background: white;
  border-radius: 16px;
  width: 400px;
  max-width: 90vw;
  padding: 28px 24px 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}
.sub-cancel-header {
  text-align: center;
  margin-bottom: 20px;
}
.sub-cancel-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 12px 0 6px;
}
.sub-cancel-header p {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}
.sub-cancel-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  background: #fef2f2;
  border-radius: 12px;
  padding: 14px 16px;
}
.sub-cancel-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: #374151;
}
.sub-cancel-note {
  font-size: 13px;
  color: #9ca3af;
  text-align: center;
  margin: 0 0 20px;
}
.sub-cancel-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sub-cancel-keep {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: #1a1a1a;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.sub-cancel-keep:hover {
  background: #333;
}
.sub-cancel-confirm {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #ef4444;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.sub-cancel-confirm:hover {
  background: #fef2f2;
}

/* =========================================================
   INLINE PAYMENT FORM (Stripe Elements)
========================================================= */
.pay-plan-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0f5ff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
}
.pay-plan-summary-name {
  font-size: 16px;
  font-weight: 700;
  color: #1e3a5f;
}
.pay-plan-summary-price {
  font-size: 20px;
  font-weight: 700;
  color: #2563eb;
}
.pay-plan-summary-price span {
  font-size: 13px;
  font-weight: 400;
  color: #6b7280;
}
.pay-card-element {
  min-height: 120px;
  margin-bottom: 16px;
}
.pay-card-fields {
  margin-bottom: 16px;
}
.pay-card-field-group {
  margin-bottom: 12px;
}
.pay-card-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.pay-card-field {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fafafa;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pay-card-field:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: white;
}
.pay-card-row {
  display: flex;
  gap: 12px;
}
.pay-card-half {
  flex: 1;
}
.pay-card-select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
  font-size: 15px;
  color: #1a1a1a;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.pay-card-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background-color: white;
}
.pay-card-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
  font-size: 15px;
  color: #1a1a1a;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.pay-card-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: white;
}
.pay-card-input::placeholder {
  color: #9ca3af;
}
.pay-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: #9ca3af;
  font-size: 14px;
}
.pay-error {
  color: #ef4444;
  font-size: 13px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #fef2f2;
  border-radius: 8px;
}
.pay-submit-btn {
  width: 100%;
  padding: 14px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.pay-submit-btn:hover:not(:disabled) {
  background: #1d4ed8;
}
.pay-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.pay-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.pay-security-note {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 14px;
}
.pay-back-link {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
  margin-top: 12px;
  text-align: center;
  padding: 8px;
}
.pay-back-link:hover {
  color: #2563eb;
}

/* Payment Success Screen */
.pay-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 0;
}
.pay-success-icon {
  margin-bottom: 16px;
  animation: paySuccessPop 0.4s ease;
}
@keyframes paySuccessPop {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
.pay-success-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px;
}
.pay-success-text {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 24px;
  line-height: 1.5;
}
.pay-success-btn {
  padding: 12px 32px;
  background: #22c55e;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.pay-success-btn:hover {
  background: #16a34a;
}

.sp-section {
  margin-bottom: 16px;
}
.sp-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  padding-left: 4px;
}
.sp-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
}
.sp-sub-info {
  padding: 14px;
}
.sp-sub-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.sp-tier-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.sp-expiry {
  font-size: 12px;
  color: #9ca3af;
}
.sp-sub-desc {
  font-size: 14px;
  color: #9ca3af;
  margin-top: 2px;
}
.sp-divider {
  height: 1px;
  background: #e5e7eb;
  margin-left: 56px;
}
.sp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
}
.sp-item-clickable {
  cursor: pointer;
}
.sp-item-clickable:hover {
  background: #f9fafb;
}
.sp-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.sp-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sp-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sp-item-label {
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
}
.sp-item-value {
  font-size: 13px;
  color: #9ca3af;
  margin-top: 1px;
}
.sp-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: white;
  padding: 14px;
  border-radius: 12px;
  margin-top: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #4a4a4a;
}
.sp-logout:hover {
  background: #f9fafb;
}
.sp-select {
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f5f5f5;
  font-size: 14px;
  color: #1a1a1a;
  cursor: pointer;
  outline: none;
}
.sp-select:focus {
  border-color: #9ca3af;
}

/* Manage Subscription page */
.mgn-plan-info {
  padding: 14px;
}
.mgn-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mgn-plan-price {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
}
.mgn-plan-price span {
  font-size: 13px;
  font-weight: 400;
  color: #9ca3af;
}
.mgn-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}
.mgn-status-active {
  background: #dcfce7;
  color: #16a34a;
}
.mgn-status-cancelling {
  background: #fef3c7;
  color: #d97706;
}
.mgn-status-past_due {
  background: #fee2e2;
  color: #dc2626;
}
.mgn-cancel-note {
  font-size: 13px;
  color: #d97706;
  margin-top: 6px;
}
.mgn-change-summary {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.mgn-change-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 15px;
  color: #4b5563;
}
.mgn-change-row + .mgn-change-row {
  border-top: 1px solid #f3f4f6;
}
.mgn-change-note {
  display: block;
  font-size: 13px;
  color: #9ca3af;
  text-align: center;
  padding-top: 10px;
}
.mgn-current-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.mgn-current-card-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  color: #6b7280;
}
.mgn-current-card-brand {
  font-weight: 600;
  color: #374151;
}
.mgn-current-card-number {
  letter-spacing: 1px;
}
.mgn-current-card-exp {
  margin-left: auto;
  font-size: 13px;
}
.mgn-card-section {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.mgn-card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 12px;
}
.mgn-card-input {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px;
  background: #fafafa;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.mgn-card-input:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: white;
}

/* Notification permission banner */
.notif-permission-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FEF3C7;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  cursor: pointer;
}
.notif-permission-banner:hover {
  background: #FDE68A;
}

/* Help & FAQ - matches mobile HelpScreen */
.help-contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.help-contact-row:hover {
  background: #f5f5f5;
}
.help-contact-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.help-contact-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
}
.help-contact-label {
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
}
.help-contact-value {
  font-size: 13px;
  color: #9ca3af;
  margin-top: 2px;
}
.help-faq-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 0 16px;
}
.help-faq-item {
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.help-faq-item:hover {
  background: #f9f9f9;
}
.help-faq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.help-faq-question {
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
  flex: 1;
  padding-right: 8px;
}
.help-faq-chevron {
  transition: transform 0.2s;
  flex-shrink: 0;
}
.help-faq-answer {
  font-size: 14px;
  color: #4a4a4a;
  line-height: 1.5;
  margin-top: 8px;
}
.help-footer {
  text-align: center;
  padding: 24px 0;
  font-size: 14px;
  color: #9ca3af;
}

/* Edit Profile form - matches mobile ProfileScreen */
.ep-field {
  display: flex;
  flex-direction: column;
}
.ep-label {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 4px;
}
.ep-input {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  color: #1a1a1a;
  outline: none;
  min-height: 42px;
}
.ep-input:focus {
  border-color: #9ca3af;
}
.ep-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.ep-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  color: #1a1a1a;
  cursor: pointer;
  min-height: 42px;
}
.ep-unit-toggle {
  display: flex;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  min-height: 42px;
}
.ep-unit-opt {
  flex: 1;
  border: none;
  background: #f9fafb;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  padding: 8px;
}
.ep-unit-opt.ep-unit-sel {
  background: #1a1a1a;
  color: white;
}
.ep-save-btn {
  width: 100%;
  padding: 14px;
  background: #1a1a1a;
  color: white;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 8px;
}
.ep-save-btn:hover {
  background: #333;
}
.ep-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.sidebar-btn {
  background: none;
  border: none;
  text-align: left;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  color: #374151;
}
.sidebar-btn:hover { background: #e5e7eb; }

/* Plan & Report */
.metric-chart {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.chart-line { width: 100%; height: 150px; display: block; }

.plan-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  padding: 16px;
  background: #f0f9ff;
  border-radius: 12px;
  border: 1px solid #bae6fd;
}
.progress-bar {
  flex: 1;
  height: 10px;
  background: rgba(0,0,0,0.05);
  border-radius: 10px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 10px;
  transition: width 0.5s ease;
}

.plan-items { display: grid; gap: 16px; }
.plan-item {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.item-header { display: flex; justify-content: space-between; }
.item-actions button {
  background: none; border: none; cursor: pointer; padding: 4px; font-size: 16px; opacity: 0.6;
}
.item-actions button:hover { opacity: 1; }

/* Auth - Legacy container (verify page) */
.auth-container, .profile-container {
  max-width: 440px;
  margin: 60px auto;
  padding: 40px;
  background: white;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  text-align: center;
}

/* ==========================================
   MODERN AUTH PAGE - Split Layout
========================================== */
.auth-page {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  background: #fff;
}

/* Left brand panel - artistic paint background */
.auth-brand {
  width: 45%;
  background:
    /* White center glow behind logo */
    radial-gradient(ellipse 40% 35% at 50% 45%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.7) 30%, transparent 70%),
    /* Golden streaks */
    radial-gradient(ellipse 60% 30% at 25% 20%, rgba(212,175,55,0.5) 0%, transparent 60%),
    radial-gradient(ellipse 40% 25% at 80% 75%, rgba(218,165,32,0.4) 0%, transparent 55%),
    /* Pink / rose washes */
    radial-gradient(ellipse 50% 40% at 10% 60%, rgba(219,112,147,0.45) 0%, transparent 60%),
    radial-gradient(ellipse 35% 30% at 85% 25%, rgba(236,72,153,0.3) 0%, transparent 55%),
    /* Blue / teal strokes */
    radial-gradient(ellipse 45% 50% at 75% 55%, rgba(59,130,246,0.4) 0%, transparent 60%),
    radial-gradient(ellipse 55% 30% at 20% 80%, rgba(56,189,248,0.35) 0%, transparent 55%),
    /* Green accents */
    radial-gradient(ellipse 30% 35% at 65% 15%, rgba(34,197,94,0.35) 0%, transparent 55%),
    radial-gradient(ellipse 40% 25% at 15% 35%, rgba(74,222,128,0.25) 0%, transparent 50%),
    /* Grey / charcoal depth */
    radial-gradient(ellipse 70% 60% at 90% 90%, rgba(55,65,81,0.5) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 5% 95%, rgba(31,41,55,0.45) 0%, transparent 55%),
    /* Dark base with slight warmth */
    linear-gradient(145deg, #1a1a2e 0%, #1e1e3a 25%, #2a1f3d 50%, #1a2332 75%, #111827 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

/* Soft paint texture overlays */
.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    /* Extra soft gold sweep */
    radial-gradient(ellipse 80% 40% at 40% 30%, rgba(251,191,36,0.15) 0%, transparent 60%),
    /* Subtle white mist in center */
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.12) 0%, transparent 40%),
    /* Deep blue corner */
    radial-gradient(ellipse 50% 60% at 95% 10%, rgba(37,99,235,0.25) 0%, transparent 50%),
    /* Dark edge vignette */
    radial-gradient(ellipse 100% 100% at 50% 50%, transparent 40%, rgba(0,0,0,0.3) 100%);
  pointer-events: none;
}

.auth-brand::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    /* Scattered paint spots */
    radial-gradient(circle 80px at 15% 15%, rgba(212,175,55,0.2) 0%, transparent 100%),
    radial-gradient(circle 60px at 80% 40%, rgba(219,112,147,0.18) 0%, transparent 100%),
    radial-gradient(circle 90px at 30% 75%, rgba(59,130,246,0.15) 0%, transparent 100%),
    radial-gradient(circle 70px at 70% 85%, rgba(34,197,94,0.18) 0%, transparent 100%),
    radial-gradient(circle 50px at 90% 15%, rgba(168,85,247,0.15) 0%, transparent 100%);
  pointer-events: none;
}

.auth-brand-content {
  text-align: center;
  position: relative;
  z-index: 1;
  margin-top: -10vh;
}

.auth-logo {
  width: 160px;
  height: auto;
  object-fit: contain;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}

.auth-brand-name {
  font-size: 36px;
  font-weight: 700;
  color: #111827;
  margin: -14px 0 2px;
  letter-spacing: -0.5px;
}

.auth-slogan {
  font-size: 17px;
  color: #374151;
  margin: 0;
  font-weight: 400;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.auth-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

.auth-feature-icon {
  color: #fbbf24;
  font-size: 14px;
  flex-shrink: 0;
}

/* Right form panel */
.auth-form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  overflow-y: auto;
}

.auth-form-inner {
  width: 100%;
  max-width: 400px;
}

/* Tabs */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
  font-family: inherit;
}

.auth-tab.active {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.auth-tab:hover:not(.active) {
  color: #374151;
}

/* Social buttons */
.auth-social-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.auth-social-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.auth-social-btn svg {
  flex-shrink: 0;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  color: #9ca3af;
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

/* Inputs */
.auth-input {
  display: block;
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: #111827;
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.auth-input::placeholder {
  color: #9ca3af;
}

/* Submit button */
.auth-submit-btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
  margin-top: 4px;
}

.auth-submit-btn:hover {
  background: #1f2937;
}

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

/* Links */
.auth-link {
  display: inline-block;
  color: #6b7280;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-link:hover {
  color: #111827;
}

.auth-forgot-link {
  display: block;
  text-align: center;
  margin-top: 16px;
}

.auth-back-link {
  display: inline-block;
  color: #6b7280;
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 0.2s;
}

.auth-back-link:hover {
  color: #111827;
}

.auth-heading {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px;
}

.auth-subtext {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 24px;
  line-height: 1.5;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .auth-page {
    flex-direction: column;
  }

  .auth-brand {
    width: 100%;
    padding: 32px 24px 24px;
  }

  .auth-brand-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .auth-logo {
    width: 80px;
    height: auto;
    object-fit: contain;
    margin-bottom: 12px;
  }

  .auth-brand-name {
    font-size: 24px;
    margin-bottom: 4px;
  }

  .auth-slogan {
    font-size: 14px;
    margin-bottom: 0;
  }

  .auth-features {
    display: none;
  }

  .auth-form {
    padding: 24px 20px 40px;
  }
}

/* Password Requirements */
.password-requirements {
  text-align: left;
  margin: 8px 0 16px;
  padding: 12px 16px;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 13px;
}

.password-requirements .requirement {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  color: #6b7280;
  transition: color 0.2s;
}

.password-requirements .requirement.met {
  color: #10b981;
}

.password-requirements .requirement .req-icon {
  font-size: 12px;
  width: 16px;
  text-align: center;
}

/* Profile Edit Card - Improved UI */
.profile-edit-container {
  max-width: 480px;
  margin: 40px auto;
  padding: 0;
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  overflow: hidden;
}

.profile-edit-header {
  background: linear-gradient(135deg, #4b5563 0%, #1f2937 100%);
  padding: 32px 24px;
  text-align: center;
  color: white;
}

.profile-edit-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  margin: 0 auto 16px;
  border: 3px solid rgba(255,255,255,0.3);
}

.profile-edit-header h2 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 600;
}

.profile-edit-header p {
  margin: 0;
  font-size: 16px;
  opacity: 0.9;
}

.profile-edit-form {
  padding: 24px;
}

.form-section {
  margin-bottom: 24px;
}

.form-section:last-of-type {
  margin-bottom: 0;
}

.form-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f3f4f6;
}

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

.form-field:last-child {
  margin-bottom: 0;
}

.form-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.form-field input,
.form-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 17px;
  color: #111827;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 0;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: #4b5563;
  box-shadow: 0 0 0 3px rgba(75, 85, 99, 0.1);
}

.form-field input.disabled-field {
  background: #f9fafb;
  color: #6b7280;
  cursor: not-allowed;
}

.form-field input::placeholder {
  color: #9ca3af;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-field {
  flex: 1;
}

.auto-badge {
  font-size: 10px;
  font-weight: 500;
  color: #9ca3af;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.auto-badge.detected {
  color: #059669;
  background: #ecfdf5;
}

.profile-edit-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #f3f4f6;
}

.profile-edit-actions .btn-primary {
  flex: 1;
  padding: 14px 20px;
  background: linear-gradient(135deg, #4b5563 0%, #1f2937 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.profile-edit-actions .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(31, 41, 55, 0.4);
}

.profile-edit-actions .btn-secondary {
  flex: 1;
  padding: 14px 20px;
  background: #f3f4f6;
  color: #374151;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.profile-edit-actions .btn-secondary:hover {
  background: #e5e7eb;
}

@media (max-width: 520px) {
  .profile-edit-container {
    margin: 20px 16px;
    border-radius: 16px;
  }

  .profile-edit-header {
    padding: 24px 20px;
  }

  .profile-edit-form {
    padding: 20px;
  }

  .form-row {
    flex-direction: column;
    gap: 16px;
  }
}
.primary-btn {
  width: 100%;
  background: #111;
  color: white;
  padding: 12px;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}
input, select {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
}

/* ===== Plan controls / pills / activity log ===== */
.plan-header-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.pill{
  font-size:12px;
  font-weight:700;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border-light);
}
.pill-draft{ background:#f3f4f6; color:#374151; }
.pill-active{ background:#ecfdf5; color:#065f46; border-color:#a7f3d0; }
.pill-cancelled{ background:#fff1f2; color:#9f1239; border-color:#fecdd3; }

.plan-controls{
  display:flex;
  gap:10px;
  margin: 14px 0 18px;
}

.primary-btn.small,
.secondary-btn.small{
  width:auto;
  padding:10px 12px;
  border-radius:10px;
  font-size:14px;
}

.secondary-btn{
  background:#f3f4f6;
  color:#111827;
  border:1px solid #e5e7eb;
  cursor:pointer;
  font-weight:600;
}
.secondary-btn:hover{ background:#e5e7eb; }

button:disabled{
  opacity:0.45;
  cursor:not-allowed;
}

.log-activity-btn{
  font-size:16px;
  padding:4px 6px;
  border-radius:8px;
  border:1px solid transparent;
}
.log-activity-btn:hover{
  border-color:#d1d5db;
  background:#f9fafb;
}


/* =========================================================
   LOADING SPINNER ANIMATION
========================================================= */

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  animation: spin 1s linear infinite;
  transform-origin: center;
}

/* Ensure the disabled button looks inactive */
.add-todo-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  color: #9ca3af;
}

/* =========================================================
   MODAL STYLES
========================================================= */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 22px;
  font-weight: 600;
  color: #111827;
}

.modal-content label {
  display: block;
  font-weight: 500;
  font-size: 15px;
  color: #1f2937;
  margin-bottom: 6px;
  margin-top: 12px;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 0;
}

.modal-content textarea {
  resize: vertical;
  font-family: inherit;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal-actions button {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #d1d5db;
  background: white;
  color: #1f2937;
}

.modal-actions button:hover {
  background: #f3f4f6;
}

.modal-actions .primary-btn {
  background: #111;
  color: white;
  border-color: #111;
}

.modal-actions .primary-btn:hover {
  background: #000;
}

.weekday-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.weekday-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f3f4f6;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  margin: 0;
}

.weekday-grid input[type="checkbox"] {
  width: auto;
  margin: 0;
}

/* =========================================================
   INTERACTIVE CHECKBOXES IN CHAT
========================================================= */

/* Selectable items: by default, show bullets like normal items */
.selectable-item {
  margin: 6px 0;
  padding-left: 8px;
}

/* Only remove list style when checkboxes are actually visible */
.selectable-item.checkbox-visible {
  list-style: none;
  margin: 8px 0;
  padding-left: 0;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.checkbox-label:hover {
  background: #f9fafb;
}

.item-checkbox {
  margin-top: 3px;
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.item-text {
  flex: 1;
  line-height: 1.5;
  font-size: 17px;
  color: #111827;
}

/* Edit Item Button */
.edit-item-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: #6b7280;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  margin-left: 8px;
}

.checkbox-label:hover .edit-item-btn {
  opacity: 1;
}

.edit-item-btn:hover {
  background: #e5e7eb;
  color: #2563eb;
}

.edit-item-btn svg {
  display: block;
}

/* Schedule Button */
.schedule-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  margin-top: 12px;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.schedule-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.schedule-btn svg {
  width: 18px;
  height: 18px;
}

.selected-count {
  background: rgba(255, 255, 255, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
}

/* =========================================================
   MODAL STYLES
========================================================= */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s;
  padding: 24px;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
  color: #111827;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #9ca3af;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.modal-body {
  padding: 24px;
}

.schedule-preview {
  background: #f9fafb;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 24px;
}

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

.schedule-options label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #374151;
}

.schedule-options input,
.schedule-options select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font);
}

.schedule-options input:focus,
.schedule-options select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
}

.btn-primary,
.btn-secondary {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

.btn-danger {
  background: #dc2626;
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

.btn-warning {
  background: #f59e0b;
  color: white;
}

.btn-warning:hover {
  background: #d97706;
  transform: translateY(-1px);
}

/* =========================================================
   CALENDAR STYLES
========================================================= */

.calendar-main {
  flex: 1;
  overflow: hidden;
  background: #f9fafb;
  height: calc(100vh - var(--topbar-height));
  max-height: calc(100vh - var(--topbar-height));
}

.calendar-container {
  max-width: 900px;
  margin: 0 auto;
}

.calendar-header {
  background: white;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.calendar-header h1 {
  margin: 0;
  font-size: 28px;
  color: #111827;
}

.calendar-day {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calendar-day.today {
  border: 2px solid var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.day-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f3f4f6;
}

.day-header h3 {
  margin: 0;
  font-size: 18px;
  color: #111827;
  flex: 1;
}

.today-badge {
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.day-events {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calendar-event {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 12px;
  border-left: 4px solid var(--primary);
  transition: all 0.2s;
}

.calendar-event:hover {
  background: #f3f4f6;
  transform: translateX(4px);
}

.event-time {
  font-weight: 700;
  color: var(--primary);
  font-size: 17px;
  min-width: 80px;
}

.event-content {
  flex: 1;
}

.event-title {
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}

.event-duration {
  font-size: 16px;
  color: #6b7280;
}

.event-delete {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.event-delete:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* =========================================================
   MESSAGE ACTIONS & TOGGLE BUTTON
========================================================= */

.message-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  opacity: 0;
  transition: opacity 0.2s;
}

.message.assistant:hover .message-actions {
  opacity: 1;
}

/* User Message Wrapper */
.user-message-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 100%;
}

.user-message-content {
  display: block;
  max-width: fit-content;
  width: auto;
}

/* User Message Actions */
.user-message-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.2s;
  padding-right: 4px;
}

.user-message-wrapper:hover .user-message-actions {
  opacity: 1;
}

.copy-message-btn,
.edit-message-btn,
.delete-message-btn,
.export-message-btn {
  background: transparent;
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.copy-message-btn:hover,
.export-message-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #111827;
}

.edit-message-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #111827;
}

.delete-message-btn:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

/* Export Dropdown */
.export-dropdown {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 4px 0;
  min-width: 170px;
  z-index: 10000;
  border: 1px solid #e5e7eb;
}

.export-dropdown-item {
  padding: 10px 14px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.export-dropdown-item:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.export-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #e5e7eb;
  border-top-color: #6b7280;
  border-radius: 50%;
  animation: export-spin 0.6s linear infinite;
}

@keyframes export-spin {
  to { transform: rotate(360deg); }
}

/* When editing, make the user message take full width */
.message.user:has(.edit-message-wrapper) {
  width: 100%;
  align-self: stretch;
}

/* Edit Message Container - Chat input style */
.edit-message-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

.edit-message-container {
  width: 100%;
  max-width: 100%;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 24px;
  padding: 10px 10px 10px 20px;
  display: flex;
  align-items: flex-end;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: border 0.2s, box-shadow 0.2s;
}

.edit-message-container:focus-within {
  border-color: #9ca3af;
  box-shadow: 0 4px 12px rgba(156, 163, 175, 0.15);
}

.edit-message-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  resize: none;
  font-size: 18px;
  min-height: 0;
  outline: none;
  line-height: 1.6;
  color: #111827;
  font-family: inherit;
  overflow-y: hidden;
}

.edit-message-input::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.edit-message-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  flex-shrink: 0;
}

.cancel-edit-btn {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.cancel-edit-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.save-edit-btn {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  background: #111827;
  color: #ffffff;
  border: 1px solid #111827;
}

.save-edit-btn:hover {
  background: #1f2937;
  border-color: #1f2937;
}

.toggle-checkbox-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-checkbox-btn:hover {
  background: #e5e7eb;
  border-color: var(--primary);
}

.toggle-checkbox-btn svg {
  width: 18px;
  height: 18px;
  color: #6b7280;
}

.toggle-checkbox-btn:hover svg {
  color: var(--primary);
}

.toggle-checkbox-btn.active {
  background: #fce7f3;
  border-color: #ec4899;
}

.toggle-checkbox-btn.active svg {
  color: #ec4899;
}

.toggle-checkbox-btn.active:hover {
  background: #fbcfe8;
  border-color: #db2777;
}

.toggle-checkbox-btn.active:hover svg {
  color: #db2777;
}

/* =========================================================
   ENHANCED MODAL FORM ELEMENTS
========================================================= */

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.btn-outline {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid var(--primary);
  background: white;
  color: var(--primary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-outline svg,
.btn-primary svg {
  width: 16px;
  height: 16px;
}

.schedule-preview {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-left: 4px solid var(--primary);
}

/* Day headers in markdown */
.day-header {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  padding: 12px 16px;
  border-radius: 10px;
  margin: 20px 0 12px 0;
  border-left: 4px solid var(--primary);
  font-size: 18px;
  color: #1e40af;
}

/* Week headers in markdown */
.week-header {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  padding: 12px 16px;
  border-radius: 10px;
  margin: 20px 0 12px 0;
  border-left: 4px solid #16a34a;
  font-size: 18px;
  color: #15803d;
}

/* Month headers in markdown */
.month-header {
  background: white;
  padding: 12px 16px;
  border-radius: 10px;
  margin: 20px 0 12px 0;
  border-left: none;
  font-size: 18px;
  color: #111827;
}

/* Phase headers in markdown */
.phase-header {
  background: linear-gradient(135deg, #fae8ff 0%, #f3e8ff 100%);
  padding: 12px 16px;
  border-radius: 10px;
  margin: 20px 0 12px 0;
  border-left: 4px solid #9333ea;
  font-size: 18px;
  color: #7e22ce;
}

/* =========================================================
   SIDEBAR TOGGLE & COLLAPSED STATE
========================================================= */

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
  overflow: hidden;
}

.sidebar.collapsed + .content,
.content.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed-width);
}

/* Sidebar Toggle Button - no longer used (replaced by icon rail) */
.sidebar-toggle-btn {
  display: none;
}

/* Collapse button inside sidebar */
.sidebar-collapse-btn {
  position: absolute;
  top: 24px;
  right: 12px;
  z-index: 5;
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: all 0.2s;
}

.sidebar-collapse-btn:hover {
  background: #e5e7eb;
  color: #111827;
}

/* Sidebar Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 12px;
  margin-top: -52px;
  margin-left: -17px;
  margin-bottom: 2px;
}

.sidebar-logo-image {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: url('owlve-logo.png') center/contain no-repeat;
}

.sidebar-logo-text {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  letter-spacing: 0.5px;
  margin-left: -20px;
  font-family: 'Satoshi', 'Helvetica Neue', 'Arial', sans-serif;
}

/* === Collapsed sidebar icon-rail styles === */

/* Logo: same size image, just centered, hide text */
.sidebar.collapsed .sidebar-logo {
  display: flex;
  justify-content: center;
  padding: 0;
  margin-top: -52px;
  margin-left: 0;
  margin-bottom: 2px;
}

.sidebar.collapsed .sidebar-logo-text {
  display: none;
}

/* Action buttons: hide text, center icon, keep same icon size */
.sidebar.collapsed .sidebar-action-btn {
  justify-content: center;
  margin: 0 6px 8px 6px;
  padding: 10px 0;
  width: calc(100% - 12px);
}

.sidebar.collapsed .sidebar-action-btn span {
  display: none;
}

/* Nav items (Agent sidebar): hide text, center icon */
.sidebar.collapsed .sidebar-nav-item {
  justify-content: center;
  margin: 0 6px 4px 6px;
  padding: 10px 0;
}

.sidebar.collapsed .sidebar-nav-item .sidebar-nav-title-large,
.sidebar.collapsed .sidebar-nav-item .sidebar-nav-arrow {
  display: none;
}

/* Search containers: fully hidden when collapsed */
.sidebar.collapsed .chat-search-container {
  display: none;
}

/* Lists: hidden when collapsed */
.sidebar.collapsed #chatList,
.sidebar.collapsed #projectList,
.sidebar.collapsed .project-list,
.sidebar.collapsed #planList {
  display: none;
}

/* Section headers: hidden when collapsed */
.sidebar.collapsed .sidebar-section-header {
  display: none;
}

/* Footer avatar: hide name, center avatar, push to bottom */
.sidebar.collapsed .sidebar-footer {
  padding: 8px 0;
  margin-top: auto;
}

.sidebar.collapsed .user-menu-btn {
  justify-content: center;
  padding: 8px 0;
  gap: 0;
  width: 100%;
}

.sidebar.collapsed .user-name {
  display: none;
}

/* Hide collapse button when sidebar is collapsed */
.sidebar.collapsed .sidebar-collapse-btn {
  display: none;
}

/* Expand button: outside sidebar, same row as logo */
.sidebar-expand-btn {
  position: fixed;
  left: var(--sidebar-collapsed-width);
  top: 24px;
  z-index: 101;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-light);
  border-left: none;
  border-radius: 0 8px 8px 0;
  padding: 8px 6px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: all 0.2s;
  box-shadow: 2px 0 6px rgba(0,0,0,0.08);
}

.sidebar-expand-btn.visible {
  display: flex;
}

.sidebar-expand-btn:hover {
  background: #e5e7eb;
  color: #111827;
}

/* Spacer: shrink in collapsed mode */
.sidebar.collapsed .sidebar-spacer {
  flex: 1;
}

/* Project list empty state: hidden */
.sidebar.collapsed .project-list-empty {
  display: none;
}

.dark .sidebar-logo-text {
  color: #f9fafb;
}

.topbar-left {
  display: none;
}

.topbar-tabs {
  display: none;
}

/* =========================================================
   CALENDAR SPLIT VIEW
========================================================= */

.calendar-split-view {
  display: flex;
  flex-direction: row;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Left panel: Event list for one day */
.calendar-left-panel {
  flex: 1;
  overflow: hidden;
  border-right: none;
  padding: 16px 20px 0;
  background: #fafafa;
  position: relative;
  display: flex;
  flex-direction: column;
}

.calendar-left-panel::after {
  content: '';
  position: absolute;
  top: 16px;
  right: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-light);
}

/* Right panel: Calendar month view */
.calendar-right-panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 20px;
  background: #fafafa;
  position: relative;
  min-width: 0;
}

/* Date navigation buttons in left panel */
.date-nav-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background: white;
  border-radius: 8px;
  margin-bottom: 8px;
  border-bottom: 2px solid #e5e7eb;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.date-nav-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  flex: 1;
  text-align: center;
}

.date-nav-btn {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #6b7280;
}

.date-nav-btn:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: white;
  transform: scale(1.1);
}

.date-nav-btn:active {
  transform: scale(0.95);
}

.date-nav-btn svg {
  width: 20px;
  height: 20px;
}

#dailyEvents {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.day-events-container {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  background: white;
  border-radius: 8px;
}

.calendar-month-nav-top {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.calendar-month-nav-bottom {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.calendar-inline-nav-btn {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #6b7280;
  transition: all 0.2s;
  font-weight: 500;
}

.calendar-inline-nav-btn:hover {
  background: #f9fafb;
  border-color: #2563eb;
  color: #2563eb;
}

.calendar-inline-nav-btn svg {
  width: 16px;
  height: 16px;
}

/* =========================================================
   MONTHLY CALENDAR
========================================================= */

.monthly-calendar {
  max-width: 700px;
  margin: 0 auto;
  background: transparent;
  display: flex;
  flex-direction: column;
  position: relative;
}

.monthly-calendar .month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px 0;
  background: white;
  padding: 12px 16px;
  border-radius: 8px;
  border-bottom: 2px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}

.month-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.month-nav-btn {
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: all 0.2s;
}

.month-nav-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

.calendar-grid {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.weekday {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: #6b7280;
  padding: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  flex: 1;
}

.calendar-day {
  aspect-ratio: 1;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 4px;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: white;
  min-height: 0;
}

.calendar-day.empty {
  cursor: default;
  background: transparent;
  border: none;
}

.calendar-day:not(.empty):hover {
  background: #f9fafb;
  border-color: #2563eb;
}

.calendar-day.today {
  background: #eff6ff;
  border-color: #2563eb;
}

.calendar-day.selected {
  background: #2563eb;
  border-color: #2563eb;
}

.calendar-day.selected .day-number {
  color: white;
  font-weight: 700;
}

.calendar-day.selected .event-indicator {
  background: white;
  color: #2563eb;
}

.day-number {
  font-size: 17px;
  font-weight: 500;
  color: #111827;
  margin-bottom: 2px;
}

.event-indicator {
  background: #2563eb;
  color: white;
  border-radius: 8px;
  padding: 1px 4px;
  font-size: 10px;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
}

/* =========================================================
   DAILY EVENTS PANEL
========================================================= */

.daily-events-container {
  max-width: 1000px;
  margin: 0 auto;
}

.daily-events-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e5e7eb;
}

.daily-events-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #111827;
}

.event-count {
  background: #eff6ff;
  color: #2563eb;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

.daily-events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.daily-event-item {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: #f9fafb;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 8px;
  transition: all 0.2s;
  cursor: pointer;
}

.daily-event-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.event-color-bar {
  width: 4px;
  flex-shrink: 0;
}

.daily-event-item .event-content {
  flex: 1;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.event-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.event-time-range {
  font-weight: 600;
  white-space: nowrap;
}

.event-duration-label {
  color: #9ca3af;
  white-space: nowrap;
}

.event-plan-label {
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.daily-event-item .event-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-status-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.event-status-done {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}

.event-status-missed {
  color: #9ca3af;
  background: rgba(156, 163, 175, 0.12);
}

/* Now indicator */
.now-indicator {
  display: flex;
  align-items: center;
  padding: 4px 12px;
  gap: 8px;
  position: relative;
}

.now-indicator-time {
  font-size: 12px;
  font-weight: 600;
  color: #ef4444;
  white-space: nowrap;
  min-width: 60px;
}

.now-indicator-line {
  flex: 1;
  height: 2px;
  background: #ef4444;
}

.now-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
}

.event-actions {
  display: flex;
  align-items: center;
  padding-right: 8px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.daily-event-item:hover .event-actions {
  opacity: 1;
}

.daily-event-item .event-edit,
.daily-event-item .event-delete {
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s;
  flex-shrink: 0;
}

.daily-event-item .event-edit:hover {
  background: #e5e7eb;
  color: #374151;
}

.daily-event-item .event-delete:hover {
  background: #fee2e2;
  color: #dc2626;
}

.no-events {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
}

.no-events svg {
  margin-bottom: 16px;
  opacity: 0.3;
}

.no-events p {
  margin: 0;
  font-size: 16px;
  color: #6b7280;
}

/* Responsive form */
@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .modal-footer {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary,
  .btn-outline {
    width: 100%;
    justify-content: center;
  }

  .calendar-left-panel {
    flex: 0 0 100%;
    border-right: none;
    border-bottom: 2px solid var(--border-light);
  }

  .calendar-right-panel {
    flex: 1;
  }

  .calendar-split-view {
    flex-direction: column;
  }

  .calendar-day {
    padding: 4px;
  }

  .day-number {
    font-size: 14px;
  }
}

/* ===== Plan Sidebar Styles ===== */

.plan-sidebar {
  background: white;
  overflow: hidden;
}

/* ===== Health Sidebar Styles ===== */

.health-sidebar {
  background: white;
  overflow: hidden;
}

.sidebar-spacer {
  flex: 1;
}

#planList {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px;
}

/* Custom scrollbar for plan list */
#planList::-webkit-scrollbar {
  width: 6px;
}

#planList::-webkit-scrollbar-track {
  background: transparent;
}

#planList::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

#planList::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

#planList .plan-item {
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 17px;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background 0.2s;
  background: transparent;
  border: none;
}

#planList .plan-item:hover {
  background: #e5e7eb;
}

#planList .plan-item.active {
  background: #e5e7eb;
  color: #111827;
  font-weight: 600;
}

#planList .plan-info {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#planList .plan-title {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#planList .plan-item:hover .plan-title {
  color: #111827;
}

#planList .plan-item.active .plan-title {
  color: #111827;
  font-weight: 600;
}

.plan-menu-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 4px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #9ca3af;
  opacity: 0;
}

.plan-item:hover .plan-menu-btn {
  opacity: 1;
}

.plan-menu-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

.plan-menu-btn svg {
  width: 16px;
  height: 16px;
}

/* Delete button styles for event rows */
.plan-event-actions .delete-btn {
  color: #9ca3af;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.plan-event-actions .delete-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

/* Button styles for modal footer */
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-danger:hover {
  background: #dc2626;
}

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

.btn-danger svg,
.btn-primary svg {
  width: 16px;
  height: 16px;
}

/* Context Menu Styles */

.context-menu {
  position: fixed;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 4px 0;
  min-width: 140px;
  z-index: 10000;
  border: 1px solid #e5e7eb;
}

.context-menu-item {
  padding: 10px 16px;
  font-size: 15px;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.context-menu-item:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.context-menu-item.danger {
  color: #dc2626;
}

.context-menu-item.danger:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.context-menu-item svg {
  width: 16px;
  height: 16px;
}

/* Plan Detail Modal Styles */

.plan-events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 500px;
  overflow-y: auto;
  padding: 4px;
}

.plan-event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  transition: all 0.2s ease;
  gap: 16px;
}

.plan-event-row:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.plan-event-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-event-title {
  font-size: 17px;
  font-weight: 500;
  color: #111827;
  word-wrap: break-word;
}

.plan-event-meta {
  font-size: 14px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.plan-event-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.plan-event-actions button:not(.icon-btn) {
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.plan-event-actions button:not(.icon-btn):first-child {
  color: #2563eb;
  border-color: #bfdbfe;
}

.plan-event-actions button:not(.icon-btn):first-child:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.plan-event-actions button:not(.icon-btn):last-child {
  color: #dc2626;
  border-color: #fecaca;
}

.plan-event-actions button:not(.icon-btn):last-child:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

/* Icon Button Styles */

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 6px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #9ca3af;
}

.icon-btn:hover {
  background: #f3f4f6;
  color: #6b7280;
}

.icon-btn.edit-btn {
  color: #9ca3af;
}

.icon-btn.edit-btn:hover {
  background: #dbeafe;
  color: #2563eb;
}

.icon-btn.delete-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Empty State for Plan List */

.plan-list-empty {
  padding: 40px 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 15px;
}

.plan-list-empty svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  opacity: 0.5;
}

/* Responsive Adjustments for Plan Sidebar */

@media (max-width: 768px) {
  .plan-item {
    padding: 10px 12px;
  }

  .plan-title {
    font-size: 15px;
  }

  .plan-menu-btn {
    opacity: 1;
  }

  .plan-event-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .plan-event-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .context-menu {
    min-width: 120px;
  }

  .sidebar-logo h2 {
    font-size: 12px;
    color: #000000;
  }

  .logo-text {
    font-size: 14px;
    color: #000000;
  }

  .logo-image {
    width: 70px;
    height: 70px;
  }

  .sidebar-action-btn {
    font-size: 13px;
    padding: 9px 10px;
  }
}

/* =========================================================
   FLOATING SCHEDULE BUTTON
========================================================= */

.floating-schedule-btn {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  display: none; /* Hidden by default, shown via JS */
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  color: white;
}

.floating-schedule-btn:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4), 0 4px 8px rgba(0, 0, 0, 0.15);
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.floating-schedule-btn:active {
  transform: scale(1.05) translateY(0px);
}

.floating-schedule-btn svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.5;
}

.floating-schedule-btn.visible {
  display: flex;
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Tooltip */
.floating-schedule-btn::before {
  content: attr(data-tooltip);
  position: absolute;
  right: 68px;
  top: 50%;
  transform: translateY(-50%);
  background: #1f2937;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.floating-schedule-btn::after {
  content: '';
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #1f2937;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.floating-schedule-btn:hover::before,
.floating-schedule-btn:hover::after {
  opacity: 1;
}

.floating-schedule-btn:hover::before {
  transform: translateY(-50%) translateX(-4px);
}

/* Badge for item count */
.schedule-btn-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #dc2626;
  color: white;
  border-radius: 10px;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  padding: 0 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ============================================
   DAILY HEALTH BUTTON (Legacy - kept for compatibility)
   ============================================ */

.daily-health-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 32px);
  margin: 0 16px 12px 16px;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.daily-health-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.daily-health-btn svg {
  flex-shrink: 0;
}

/* ============================================
   DAILY HEALTH CONTAINER
   ============================================ */

.daily-health-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px 24px;
}

.daily-health-header {
  text-align: center;
  margin-bottom: 32px;
}

.daily-health-header h1 {
  font-size: 36px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px 0;
}

.daily-health-header .subtitle {
  font-size: 17px;
  color: #374151;
  margin: 0;
}

/* ============================================
   HEALTH NEWS CARD
   ============================================ */

.health-news-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.health-news-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(to right, #f9fafb, #ffffff);
}

.health-news-card .card-header h2 {
  font-size: 22px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.health-news-card .card-date {
  font-size: 16px;
  color: #6b7280;
}

.health-news-card .card-body {
  padding: 24px;
}

.news-headline {
  font-size: 26px;
  font-weight: 600;
  color: #111827;
  line-height: 1.4;
  margin: 0 0 16px 0;
}

.news-summary {
  font-size: 20px;
  line-height: 1.6;
  color: #111827;
  margin: 0 0 20px 0;
}

.citation-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.citation-chip:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.citation-chip svg {
  flex-shrink: 0;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.source-chip .source-label {
  color: #6b7280;
}

/* ============================================
   EVENTS SUMMARY CARD
   ============================================ */

.events-summary-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.events-summary-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(to right, #f9fafb, #ffffff);
}

.events-summary-card .card-header h2 {
  font-size: 22px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.update-summary-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #f3f4f6;
  color: #4b5563;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.update-summary-btn:hover:not(:disabled) {
  background: #e5e7eb;
  color: #1f2937;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.update-summary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.update-summary-btn.loading svg {
  animation: rotate 1s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.update-summary-btn svg {
  flex-shrink: 0;
}

.events-summary-card .card-body {
  padding: 24px;
}

.events-summary-text {
  font-size: 20px;
  line-height: 1.7;
  color: #111827;
  margin: 0;
  white-space: pre-line; /* Preserve paragraph breaks */
}

.placeholder-text {
  font-size: 15px;
  color: #9ca3af;
  text-align: center;
  padding: 20px;
  margin: 0;
}

/* ============================================
   LOADING & ERROR STATES
   ============================================ */

.loading-spinner {
  text-align: center;
  padding: 40px;
  font-size: 16px;
  color: #6b7280;
}

.error-message {
  text-align: center;
  padding: 40px;
  font-size: 16px;
  color: #dc2626;
  background: #fef2f2;
  border-radius: 8px;
  border: 1px solid #fecaca;
}

/* ============================================
   USER PROFILE MODALS
   ============================================ */

.profile-section {
  text-align: center;
  padding: 24px 0;
  border-bottom: 1px solid #e5e7eb;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 600;
  margin: 0 auto;
}

.profile-info-item {
  padding: 16px 0;
  border-bottom: 1px solid #f3f4f6;
}

.profile-info-item:last-child {
  border-bottom: none;
}

.profile-info-item label {
  font-size: 13px;
  color: #6b7280;
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

.profile-info-value {
  font-size: 16px;
  color: #111827;
  font-weight: 500;
}

/* Profile View Modal - Enhanced */
.profile-view-modal {
  max-width: 520px !important;
  padding: 0 !important;
  overflow: hidden;
  border-radius: 20px !important;
}

.profile-view-header {
  background: linear-gradient(135deg, #4b5563 0%, #1f2937 100%);
  padding: 32px 24px;
  text-align: center;
  color: white;
  position: relative;
}

.profile-view-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 600;
  margin: 0 auto 16px;
  border: 3px solid rgba(255,255,255,0.3);
}

.profile-view-header h2 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 600;
}

.profile-view-header p {
  margin: 0;
  font-size: 16px;
  opacity: 0.9;
}

.modal-close-light {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: background 0.2s;
}

.modal-close-light:hover {
  background: rgba(255,255,255,0.3);
}

.profile-view-body {
  padding: 24px;
}

.profile-view-section {
  margin-bottom: 24px;
}

.profile-view-section:last-child {
  margin-bottom: 0;
}

.profile-view-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f3f4f6;
}

.profile-view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.profile-view-item {
  padding: 14px 16px;
  background: #f9fafb;
  border-radius: 12px;
}

.profile-view-item.full-width {
  grid-column: 1 / -1;
}

.profile-view-item label {
  display: block;
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 4px;
}

.profile-view-item span {
  display: block;
  font-size: 17px;
  color: #111827;
  font-weight: 500;
  word-break: break-word;
}

.profile-view-footer {
  padding: 20px 24px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.profile-view-footer .btn-secondary {
  padding: 12px 24px;
  background: #f3f4f6;
  color: #374151;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.profile-view-footer .btn-secondary:hover {
  background: #e5e7eb;
}

.profile-view-footer .btn-primary {
  padding: 12px 24px;
  background: linear-gradient(135deg, #4b5563 0%, #1f2937 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.profile-view-footer .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(31, 41, 55, 0.4);
}

@media (max-width: 520px) {
  .profile-view-grid {
    grid-template-columns: 1fr;
  }

  .profile-view-header {
    padding: 24px 20px;
  }

  .profile-view-body {
    padding: 20px;
  }
}

/* Settings Modal */
.settings-section {
  padding: 20px 0;
  border-bottom: 1px solid #e5e7eb;
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section h3 {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 16px 0;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
}

.settings-label {
  font-size: 17px;
  font-weight: 500;
  color: #111827;
  margin-bottom: 2px;
}

.settings-description {
  font-size: 15px;
  color: #6b7280;
}

.settings-select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #111827;
  background: white;
  cursor: pointer;
  min-width: 120px;
}

.settings-toggle {
  width: 42px;
  height: 24px;
  appearance: none;
  background: #e5e7eb;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.settings-toggle:checked {
  background: #2563eb;
}

.settings-toggle::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: left 0.2s;
}

.settings-toggle:checked::after {
  left: 21px;
}

/* Toggle Switch - Modern iOS-style toggle */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #2563eb;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Pricing Cards */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 20px 0;
}

.pricing-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  position: relative;
  transition: all 0.2s;
}

.pricing-card:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.pricing-card.featured {
  border-color: #2563eb;
  background: linear-gradient(to bottom, #eff6ff 0%, white 20%);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #2563eb;
  color: white;
  padding: 4px 16px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.pricing-header h3 {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 12px 0;
}

.pricing-price {
  font-size: 36px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 20px;
}

.pricing-price span {
  font-size: 16px;
  color: #6b7280;
  font-weight: 400;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}

.pricing-features li {
  padding: 8px 0;
  font-size: 14px;
  color: #4b5563;
}

.pricing-button {
  width: 100%;
  padding: 12px;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  background: white;
  color: #374151;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pricing-button:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.pricing-button.primary {
  background: #2563eb;
  border-color: #2563eb;
  color: white;
}

.pricing-button.primary:hover {
  background: #1d4ed8;
}

.pricing-button.current {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #6b7280;
  cursor: default;
}

.pricing-button.current:hover {
  border-color: #e5e7eb;
  color: #6b7280;
}

/* Help Modal */
.help-section {
  padding: 20px 0;
  border-bottom: 1px solid #e5e7eb;
}

.help-section:last-child {
  border-bottom: none;
}

.help-section h3 {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 16px 0;
}

.help-item {
  margin-bottom: 16px;
}

.help-item:last-child {
  margin-bottom: 0;
}

.help-item strong {
  font-size: 15px;
  color: #111827;
  display: block;
  margin-bottom: 8px;
}

.help-item p {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  line-height: 1.6;
}

.help-contact-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
}

.help-contact-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.btn-primary {
  background: #111827;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #1f2937;
}

.btn-secondary {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   EVENT NOTIFICATION ANIMATIONS
========================================================= */

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Event completion status colors */
.event-completed {
  border-left: 4px solid #10b981 !important;
}

.event-missed {
  color: #9ca3af !important;
}

.event-time-completed {
  color: #10b981 !important;
  font-weight: 600;
}

.event-time-missed {
  color: #9ca3af !important;
}

/* Like Summary Button */
.like-summary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #f3f4f6;
  border: none;
  color: #6b7280;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.like-summary-btn:hover:not(:disabled) {
  background: #e5e7eb;
  color: #4b5563;
}

.like-summary-btn.liked {
  background: #f3f4f6;
  color: #ec4899;
}

.like-summary-btn.liked svg {
  fill: #ec4899;
}

.like-summary-btn.liked:hover:not(:disabled) {
  background: #e5e7eb;
  color: #db2777;
}

.like-summary-btn.liked:hover:not(:disabled) svg {
  fill: #db2777;
}

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

.like-summary-btn svg {
  flex-shrink: 0;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Sidebar Text Button (no background) */
.sidebar-text-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 8px;
  width: 100%;
  text-align: left;
}

.sidebar-text-btn:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.sidebar-text-btn.active {
  background: #eff6ff;
  color: #2563eb;
}

.sidebar-text-btn svg {
  flex-shrink: 0;
}

/* Liked Summaries View */
.liked-summaries-header {
  margin-bottom: 32px;
}

.liked-summaries-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 8px 0;
}

.liked-summaries-header .subtitle {
  color: #6b7280;
  font-size: 14px;
  margin: 0;
}

.liked-summaries-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.liked-summary-item {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: box-shadow 0.2s;
}

.liked-summary-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.liked-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.liked-summary-date {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.liked-summary-liked-at {
  font-size: 12px;
  color: #9ca3af;
}

.delete-summary-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
}

.delete-summary-btn:hover {
  background: #fef2f2;
  color: #dc2626;
}

.liked-summary-text {
  font-size: 18px;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 16px;
}

.summary-adjustment-info {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
}

/* =========================================================
   DAILY INSIGHTS
========================================================= */

/* Date header center with insights toggle */
.date-header-center {
  text-align: center;
  flex: 1;
}

/* Insights toggle button in header */
.insights-toggle-btn-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  margin-top: 0;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.insights-toggle-btn-header:hover {
  background: #e5e7eb;
  color: #374151;
}

.insights-toggle-btn-header.active {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.insights-toggle-btn-header svg {
  flex-shrink: 0;
}

/* =========================================================
   TIMELINE VIEW
========================================================= */

/* Timeline toggle button in header */
.timeline-toggle-btn-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  color: #6b7280;
  padding: 0;
  margin-right: 4px;
}

.timeline-toggle-btn-header:hover {
  background: #e5e7eb;
  color: #374151;
}

.timeline-toggle-btn-header.active {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

/* Timeline container - scrolls via parent .day-events-container */
.timeline-view {
  position: relative;
}

/* The full grid area */
.timeline-grid {
  position: relative;
  min-height: 1380px;
}

/* One hour row */
.timeline-hour-row {
  height: 60px;
  display: flex;
  align-items: flex-start;
  position: relative;
}

/* Hour label on the left */
.timeline-hour-label {
  width: 50px;
  flex-shrink: 0;
  font-size: 13px;
  color: #9ca3af;
  text-align: right;
  padding-right: 8px;
  transform: translateY(-8px);
  line-height: 1;
}

/* The gridline - starts after the label */
.timeline-hour-line {
  flex: 1;
  border-top: 1px solid #e5e7eb;
}

/* Events column - overlayed absolutely */
.timeline-events-col {
  position: absolute;
  top: 0;
  left: 50px;
  right: 0;
  bottom: 0;
}

/* Individual event block */
.timeline-event-block {
  position: absolute;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 0.15s;
  z-index: 1;
  min-height: 20px;
  box-sizing: border-box;
}

.timeline-event-block:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  z-index: 2;
}

.timeline-event-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.timeline-event-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Red now-indicator line */
.timeline-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #ef4444;
  z-index: 3;
}

.timeline-now-line::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
}

/* Old toggle container - hidden */
.insights-toggle-container {
  display: none;
}

/* Old insights toggle button - kept for backwards compat */
.insights-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.insights-toggle-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

.insights-toggle-btn.active {
  background: #dbeafe;
  color: #2563eb;
  border-color: #93c5fd;
}

.insights-toggle-btn.active:hover {
  background: #bfdbfe;
}

.insights-toggle-btn svg {
  flex-shrink: 0;
}

/* Daily insights card */
.daily-insights-card {
  padding: 20px;
}

/* Insights sections */
.insights-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.insights-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.insights-section-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 6px 0;
}

.insights-section-subtitle {
  font-size: 15px;
  color: #6b7280;
  margin: 0 0 16px 0;
}

/* Balance bar */
.balance-bar {
  display: flex;
  width: 100%;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.balance-segment {
  height: 100%;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
}

.balance-segment:hover {
  opacity: 0.8;
}

/* Balance legend */
.balance-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.balance-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
}

.balance-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.balance-label {
  color: #374151;
  font-weight: 500;
}

.balance-value {
  color: #6b7280;
  font-weight: 400;
}

.balance-total {
  font-size: 16px;
  color: #6b7280;
  font-weight: 500;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
}

/* Observation */
.insights-observation {
  font-size: 16px;
  line-height: 1.6;
  color: #374151;
  margin: 12px 0;
}

.insights-suggestion {
  font-size: 16px;
  line-height: 1.6;
  color: #2563eb;
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
  padding: 12px 16px;
  border-radius: 6px;
  margin: 12px 0 0 0;
}

/* Reflection choices */
.reflection-choices {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.reflection-choice-btn {
  flex: 1;
  padding: 12px 20px;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
}

.reflection-choice-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.reflection-choice-btn.selected {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #1e40af;
}

/* Insights pending state */
.insights-pending {
  text-align: center;
  padding: 32px 16px;
}

.insights-pending-icon {
  margin-bottom: 16px;
}

.insights-pending-message {
  font-size: 16px;
  color: #6b7280;
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto;
}

/* Insights unavailable state */
.insights-unavailable {
  text-align: center;
  padding: 32px 16px;
}

.insights-unavailable-icon {
  margin-bottom: 16px;
}

.insights-unavailable-message {
  font-size: 16px;
  color: #9ca3af;
  line-height: 1.6;
}

/* Insights divider */
.insights-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 20px 0;
}

/* Previous day label */
.insights-previous-day-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  text-align: center;
}

/* Saved reflection display */
.insights-reflection-saved {
  font-size: 14px;
  color: #374151;
  background: #f3f4f6;
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 8px;
}

/* Daily section header when showing both daily and weekly */
.daily-section-header {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 12px 0;
  padding: 0;
}

/* Weekly insights styles */
.weekly-insights {
  padding: 20px;
}

.weekly-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.weekly-title {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 6px 0;
}

.weekly-date-range {
  font-size: 16px;
  color: #6b7280;
}

.weekly-observation {
  background: #fefce8;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.weekly-observation.warning-section {
  border-left: 4px solid #f59e0b;
  background: #fffbeb;
}

.weekly-observation .insights-section-title {
  color: #854d0e;
}

.weekly-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.weekly-detail-chip {
  font-size: 14px;
  padding: 6px 12px;
  background: #fef9c3;
  color: #713f12;
  border-radius: 12px;
}

/* Timing patterns grid */
.timing-patterns-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.timing-pattern-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.timing-pattern-item.best {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.timing-pattern-label {
  display: block;
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 4px;
}

.timing-pattern-rate {
  display: block;
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
}

.timing-pattern-count {
  display: block;
  font-size: 13px;
  color: #9ca3af;
  margin-top: 2px;
}

/* Activity patterns list */
.activity-patterns-list {
  margin-top: 12px;
}

.activity-pattern-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}

.activity-pattern-item:last-child {
  border-bottom: none;
}

.activity-pattern-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.activity-pattern-name {
  font-size: 15px;
  color: #374151;
  width: 90px;
  flex-shrink: 0;
}

.activity-pattern-bar-container {
  flex: 1;
  height: 10px;
  background: #f3f4f6;
  border-radius: 5px;
  overflow: hidden;
}

.activity-pattern-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 0.3s;
}

.activity-pattern-rate {
  font-size: 15px;
  font-weight: 500;
  color: #1f2937;
  width: 45px;
  text-align: right;
}

/* What's working section */
.whats-working {
  background: #f0fdf4;
  border-radius: 8px;
  padding: 16px;
}

.whats-working .insights-section-title {
  color: #166534;
}

.whats-working-list {
  margin-top: 12px;
}

.whats-working-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
}

.whats-working-icon {
  width: 24px;
  height: 24px;
  background: #22c55e;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.whats-working-content {
  flex: 1;
}

.whats-working-content strong {
  font-size: 16px;
  color: #166534;
}

.whats-working-content p {
  font-size: 15px;
  color: #4b5563;
  margin: 4px 0 0 0;
}

/* =========================================================
   QUICK PROMPTS (Life Coach)
========================================================= */

.quick-prompts-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  margin: 40px auto;
  max-width: 700px;
}

.quick-prompts-title {
  font-size: 14px;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}

.quick-prompts-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 800px;
}

/* Prompt Categories */
.prompt-category {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prompt-category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-left: 4px;
}

.prompt-category-header svg {
  width: 16px;
  height: 16px;
  color: #9ca3af;
}

.prompt-category-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dark .prompt-category-header {
  color: #9ca3af;
}

.dark .prompt-category-header svg {
  color: #6b7280;
}

.quick-prompt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-prompt-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.quick-prompt-btn svg {
  color: #6b7280;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.quick-prompt-btn span {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

/* Dark mode */
.dark .quick-prompts-container {
  background: transparent;
}

.dark .quick-prompts-title {
  color: #6b7280;
}

.dark .quick-prompt-btn {
  background: #1f2937;
  border-color: #374151;
}

.dark .quick-prompt-btn:hover {
  background: #374151;
  border-color: #D4AF37;
}

.dark .quick-prompt-btn span {
  color: #e5e7eb;
}

/* Quick Prompts - Input Area (always visible chips) */
.quick-prompts-input-area {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.quick-prompts-label {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.quick-prompts-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-prompt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.quick-prompt-chip:hover {
  background: #fff;
  border-color: #D4AF37;
  color: #D4AF37;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.15);
}

.quick-prompt-chip svg {
  color: #9ca3af;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.quick-prompt-chip:hover svg {
  color: #D4AF37;
}

/* Dark mode for quick prompts chips */
.dark .quick-prompts-input-area {
  border-bottom-color: #374151;
}

.dark .quick-prompts-label {
  color: #6b7280;
}

.dark .quick-prompt-chip {
  background: #1f2937;
  border-color: #374151;
  color: #d1d5db;
}

.dark .quick-prompt-chip:hover {
  background: #374151;
  border-color: #D4AF37;
  color: #D4AF37;
}

.dark .quick-prompt-chip svg {
  color: #6b7280;
}

.dark .quick-prompt-chip:hover svg {
  color: #D4AF37;
}

/* Responsive - stack on mobile */
@media (max-width: 500px) {
  .quick-prompts-chips {
    gap: 6px;
  }

  .quick-prompt-chip {
    padding: 6px 12px;
    font-size: 12px;
  }

  .quick-prompt-chip svg {
    width: 14px;
    height: 14px;
  }
}

/* =========================================================
   PROJECT PAGE STYLES
========================================================= */

.agent-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.project-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fafafa;
}

.project-page-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 32px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.back-to-agent-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #f5f5f5;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
}

.back-to-agent-btn:hover {
  background: #ebebeb;
  border-color: #d1d5db;
  color: #1f2937;
}

.project-page-title {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.project-page-title .project-icon {
  font-size: 28px;
}

.project-page-title h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #1a1a1a;
}

.project-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.project-status-badge.ready, .project-status-badge.completed { background: #d1fae5; color: #065f46; }
.project-status-badge.researching { background: #fef3c7; color: #92400e; }
.project-status-badge.planning { background: #dbeafe; color: #1e40af; }
.project-status-badge.scheduling { background: #e0e7ff; color: #3730a3; }
.project-status-badge.generating_guides { background: #fce7f3; color: #9d174d; }
.project-status-badge.error { background: #fee2e2; color: #991b1b; }
.project-status-badge.idle { background: #f3f4f6; color: #6b7280; }

.processing-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.processing-spinner.large {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.project-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.project-delete-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  color: #4b5563;
}

.project-delete-btn:active {
  transform: scale(0.95);
}

.project-page-tabs {
  display: flex;
  gap: 6px;
  padding: 16px 32px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.project-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 18px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.project-tab:hover {
  color: #1a1a1a;
}

.project-tab.active {
  color: #1a1a1a;
  font-weight: 600;
}

.project-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 24px;
  right: 24px;
  height: 2px;
  background: #1a1a1a;
  border-radius: 1px;
}

.project-tab svg {
  flex-shrink: 0;
}

.project-page-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  background: #fafafa;
}

/* Project Loading */
.project-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #6b7280;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: #D4AF37;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

/* Project Processing Status */
.project-processing-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #6b7280;
}

.project-processing-status .processing-step {
  font-size: 15px;
  color: #4b5563;
  margin-top: 12px;
}

/* Inline progress bar shown above plan items when still processing */
.project-progress-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: #f0f4ff;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.progress-bar-icon {
  display: flex;
  align-items: center;
  color: #4f46e5;
}

.progress-bar-label {
  font-size: 13px;
  color: #4338ca;
  font-weight: 500;
}

/* Project Overview */
.project-overview-content {
  max-width: 900px;
  margin: 0 auto;
}

.overview-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.overview-box h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}

.overview-box > p {
  margin: 0;
  color: #374151;
  line-height: 1.7;
  font-size: 18px;
}

.goal-box .goal-deadline {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
  font-size: 15px;
  color: #6b7280;
}

.action-items-count {
  color: #6b7280 !important;
  font-size: 15px !important;
  margin-bottom: 20px !important;
}

.action-items-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.overview-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px 24px;
  transition: all 0.2s ease;
}

.overview-item:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.overview-item-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.item-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #D4AF37;
  color: #fff;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.item-title-section {
  flex: 1;
}

.item-title {
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.4;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-tag {
  display: inline-block;
  padding: 5px 12px;
  background: #e5e7eb;
  color: #374151;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.meta-tag.priority-high {
  background: #e5e7eb;
  color: #1a1a1a;
}

.meta-tag.priority-medium {
  background: #e5e7eb;
  color: #6b7280;
}

.meta-tag.priority-low {
  background: #e5e7eb;
  color: #6b7280;
}

.item-description {
  margin: 0 0 16px 0;
  color: #4b5563;
  font-size: 17px;
  line-height: 1.7;
  padding-left: 48px;
}

.item-detail-section {
  margin-top: 16px;
  padding: 18px 24px;
  padding-left: 68px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #f3f4f6;
}

.item-detail-section h5 {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.item-detail-section p {
  margin: 0;
  color: #374151;
  font-size: 16px;
  line-height: 1.7;
}

/* Legacy project-description for backwards compatibility */
.project-description {
  background: #fff;
  padding: 28px 32px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  margin-bottom: 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.project-description h3 {
  margin: 0 0 14px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}

.project-description p {
  margin: 0;
  color: #374151;
  line-height: 1.7;
  font-size: 18px;
}

.project-description .target-date {
  margin-top: 16px;
  font-size: 16px;
  color: #6b7280;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
}

.processing-status-card {
  background: linear-gradient(135deg, #FDF6E3 0%, #F5ECD7 100%);
  padding: 36px;
  border-radius: 16px;
  text-align: center;
  margin-bottom: 28px;
  border: 1px solid #E8DFC6;
}

.processing-animation {
  margin-bottom: 20px;
}

.processing-status-card h3 {
  margin: 0 0 10px 0;
  font-size: 20px;
  color: #8B7355;
  font-weight: 600;
}

.processing-status-card p {
  margin: 0;
  color: #9A8A6E;
  font-size: 16px;
}

.overview-section {
  background: #fff;
  padding: 28px 32px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.overview-section h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}

.overview-section p {
  margin: 0 0 6px 0;
  color: #374151;
  font-size: 18px;
  line-height: 1.7;
}

.overview-section .sub-text {
  font-size: 13px;
  color: #9ca3af;
}

.view-section-btn {
  margin-top: 16px;
  padding: 10px 20px;
  background: #D4AF37;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.view-section-btn:hover {
  background: #b8972f;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: #9ca3af;
}

.empty-state svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #6b7280;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
}

/* Project Messages List */
.project-messages-list {
  max-width: 800px;
  margin: 0 auto;
}

.section-intro {
  margin: 0 0 20px 0;
  color: #6b7280;
  font-size: 14px;
}

.project-chat-item {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  margin-bottom: 12px;
}

.chat-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.chat-status-icon {
  font-size: 16px;
}

.chat-title {
  font-weight: 600;
  color: #1f2937;
}

.chat-prompt {
  margin: 0 0 16px 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
}

.view-chat-btn {
  padding: 8px 16px;
  background: #f3f4f6;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-chat-btn:hover {
  background: #e5e7eb;
  color: #1f2937;
}

/* Project Plan Items */
.project-plan-items {
  max-width: 800px;
  margin: 0 auto;
}

.schedule-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #D4AF37;
  margin-bottom: 20px;
}

.schedule-actions span {
  font-weight: 500;
  color: #92400e;
}

.schedule-selected-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #D4AF37;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.schedule-selected-btn:hover {
  background: #b8972f;
}

.schedule-buttons {
  display: flex;
  gap: 10px;
}

.smart-schedule-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.smart-schedule-btn:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Smart Schedule Chat Interface */
.smart-schedule-chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 500px;
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.smart-schedule-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
}

.smart-schedule-header .back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.smart-schedule-header .back-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.smart-schedule-header h3 {
  margin: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
}

.smart-schedule-header .schedule-date {
  font-size: 14px;
  opacity: 0.9;
}

.smart-schedule-header .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger {
  background: rgba(220, 38, 38, 0.8);
  color: #fff;
}

.btn-danger:hover {
  background: rgba(220, 38, 38, 1);
}

.history-mode-notice {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  text-align: center;
}

.history-mode-notice p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.dark .history-mode-notice {
  background: linear-gradient(135deg, rgba(67, 56, 202, 0.2) 0%, rgba(109, 40, 217, 0.2) 100%);
  border-color: rgba(99, 102, 241, 0.3);
}

.dark .history-mode-notice p {
  color: #9ca3af;
}

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

.smart-schedule-welcome {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
}

.smart-schedule-welcome .welcome-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.smart-schedule-welcome h4 {
  margin: 0 0 12px 0;
  font-size: 20px;
  color: #1f2937;
}

.smart-schedule-welcome p {
  margin: 0 0 16px 0;
}

.smart-schedule-welcome ul {
  text-align: left;
  max-width: 400px;
  margin: 0 auto;
  padding-left: 24px;
}

.smart-schedule-welcome li {
  margin-bottom: 8px;
}

.smart-schedule-message {
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

.smart-schedule-message.user {
  align-self: flex-end;
}

.smart-schedule-message.assistant {
  align-self: flex-start;
}

.smart-schedule-message .message-content {
  padding: 14px 18px;
  border-radius: 16px;
  line-height: 1.6;
}

.smart-schedule-message.user .message-content {
  background: #6366f1;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.smart-schedule-message.assistant .message-content {
  background: #f3f4f6;
  color: #1f2937;
  border-bottom-left-radius: 4px;
}

.smart-schedule-message.generating .message-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.smart-schedule-message .typing-indicator {
  display: flex;
  gap: 4px;
}

.smart-schedule-message .typing-indicator span {
  width: 8px;
  height: 8px;
  background: #9ca3af;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.smart-schedule-message .typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.smart-schedule-message .typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

.smart-schedule-message .generating-text {
  color: #6b7280;
  font-style: italic;
}

/* Schedule formatting in messages */
.schedule-heading {
  margin: 16px 0 8px 0;
  color: #4f46e5;
}

.schedule-day-header {
  margin: 20px 0 12px 0;
  padding: 8px 12px;
  background: #e0e7ff;
  border-radius: 8px;
  font-weight: 600;
  color: #4338ca;
}

.schedule-time-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin: 8px 0;
}

.schedule-time-entry .time {
  font-weight: 600;
  color: #6366f1;
  min-width: 80px;
}

.schedule-time-entry .activity {
  flex: 1;
  color: #1f2937;
}

.smart-schedule-input-area {
  padding: 16px 20px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.start-date-picker {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
}

.start-date-picker label {
  font-weight: 500;
  color: #374151;
}

.start-date-picker input[type="date"] {
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

.start-date-picker .btn-primary {
  padding: 10px 20px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.start-date-picker .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.chat-input-container {
  display: flex;
  gap: 12px;
}

.chat-input-container input[type="text"] {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.2s ease;
}

.chat-input-container input[type="text"]:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.chat-input-container .send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #111827;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chat-input-container .send-btn:hover:not(:disabled) {
  background: #1f2937;
}

.chat-input-container .send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.plan-items-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.plan-item {
  display: flex;
  gap: 18px;
  padding: 24px 28px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.plan-item.selected {
  border-color: #D4AF37;
  background: #FDFCF9;
}

.plan-item.scheduled {
  opacity: 0.75;
  background: #fafafa;
}

.plan-item-checkbox {
  display: flex;
  align-items: flex-start;
  padding-top: 4px;
}

.plan-item-checkbox input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: #D4AF37;
  cursor: pointer;
}

.scheduled-check {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #6b7280;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
}

.scheduled-check-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #6b7280;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scheduled-check-btn:hover {
  background: #374151;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(55, 65, 81, 0.3);
}

.scheduled-check-btn:active {
  transform: scale(0.95);
}

.plan-item-content {
  flex: 1;
}

.plan-item-content h4 {
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}

.plan-item-content p {
  margin: 0 0 14px 0;
  color: #4b5563;
  font-size: 16px;
  line-height: 1.6;
}

.plan-item-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-tag {
  padding: 6px 12px;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 14px;
  color: #6b7280;
}

.meta-tag.frequency { background: #f5f5f5; color: #374151; }
.meta-tag.duration { background: #f5f5f5; color: #374151; }
.meta-tag.type { background: #FDF6E3; color: #8B7355; }

/* Priority styling */
.meta-tag.priority-high { background: #e5e7eb; color: #1a1a1a; font-weight: 600; }
.meta-tag.priority-medium { background: #e5e7eb; color: #6b7280; }
.meta-tag.priority-low { background: #e5e7eb; color: #6b7280; }

.plan-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.plan-item-header h4 {
  margin: 0;
}

.priority-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.priority-badge.high {
  background: #e5e7eb;
  color: #1a1a1a;
}

.plan-item.priority-high {
  border-left: 4px solid #dc2626;
}

.plan-item.priority-medium {
  border-left: 4px solid #d97706;
}

.plan-item.priority-low {
  border-left: 4px solid #9ca3af;
}

.scheduled-badge {
  align-self: flex-start;
  padding: 6px 12px;
  background: #10b981;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
}

/* Expandable Plan Items */
.plan-item.expandable {
  flex-direction: column;
  padding: 0;
}

.plan-item.expandable .plan-item-main {
  display: flex;
  gap: 16px;
  padding: 20px;
  align-items: flex-start;
}

.plan-item-expand-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  color: #9ca3af;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plan-item-expand-btn:hover {
  background: #f3f4f6;
  color: #6b7280;
}

.plan-item-expand-btn svg {
  transition: transform 0.3s ease;
}

.plan-item.expanded .plan-item-expand-btn svg {
  transform: rotate(180deg);
}

.plan-item-details {
  display: none;
  padding: 0 20px 20px 56px;
  border-top: 1px solid #e5e7eb;
  animation: slideDown 0.3s ease;
}

.plan-item.expanded .plan-item-details {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-section {
  margin-top: 16px;
}

.detail-section:first-child {
  margin-top: 16px;
}

.detail-section h5 {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-icon {
  font-size: 14px;
}

.detail-content {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  padding-left: 4px;
}

.detail-content ul {
  margin: 0;
  padding-left: 20px;
}

.detail-content li {
  margin-bottom: 4px;
}

/* Structured content styles for plan item details */
.detail-content .step-list {
  margin: 0;
  padding-left: 20px;
  counter-reset: step-counter;
}

.detail-content .step-list li {
  margin-bottom: 12px;
  position: relative;
}

.detail-content .step-task {
  color: #374151;
}

.detail-content .step-outcome {
  display: block;
  margin-top: 4px;
  color: #059669;
  font-size: 13px;
  font-style: italic;
}

.detail-content .procedure-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.detail-content .procedure-item strong {
  display: block;
  margin-bottom: 8px;
  color: #1f2937;
}

.detail-content .procedure-link,
.detail-content .procedure-attachment {
  display: inline-block;
  color: #2563eb;
  text-decoration: none;
  padding: 6px 12px;
  background: #eff6ff;
  border-radius: 6px;
  font-size: 13px;
  transition: background 0.2s;
}

.detail-content .procedure-link:hover,
.detail-content .procedure-attachment:hover {
  background: #dbeafe;
  text-decoration: underline;
}

.detail-content .procedure-content {
  margin-top: 8px;
  padding: 8px 12px;
  background: #fff;
  border-left: 3px solid #6366f1;
  font-size: 13px;
  line-height: 1.5;
}

.detail-content .content-overview {
  margin: 0 0 12px 0;
  padding: 8px 12px;
  background: #f0fdf4;
  border-left: 3px solid #10b981;
  border-radius: 0 6px 6px 0;
  color: #374151;
}

.detail-content .content-section {
  margin-bottom: 12px;
}

.detail-content .content-section strong {
  color: #374151;
  display: block;
  margin-bottom: 6px;
}

.detail-content .content-section ul {
  margin: 0;
  padding-left: 20px;
}

.detail-content .content-section li {
  margin-bottom: 4px;
}

.detail-content .content-section a {
  color: #2563eb;
  text-decoration: none;
}

.detail-content .content-section a:hover {
  text-decoration: underline;
}

/* Dark mode for structured content */
.dark .detail-content .step-task {
  color: #e5e7eb;
}

.dark .detail-content .step-outcome {
  color: #34d399;
}

.dark .detail-content .procedure-item {
  background: #1f2937;
  border-color: #374151;
}

.dark .detail-content .procedure-item strong {
  color: #f3f4f6;
}

.dark .detail-content .procedure-link,
.dark .detail-content .procedure-attachment {
  background: #1e3a5f;
  color: #60a5fa;
}

.dark .detail-content .procedure-link:hover,
.dark .detail-content .procedure-attachment:hover {
  background: #1e4070;
}

.dark .detail-content .procedure-content {
  background: #111827;
  border-left-color: #818cf8;
  color: #d1d5db;
}

.dark .detail-content .content-overview {
  background: #064e3b;
  border-left-color: #34d399;
  color: #d1fae5;
}

.dark .detail-content .content-section strong {
  color: #e5e7eb;
}

.dark .detail-content .content-section a {
  color: #60a5fa;
}

.meta-tag.time-period {
  background: #e0e7ff;
  color: #4338ca;
}

.meta-tag.details-available {
  background: #fef3c7;
  color: #92400e;
  cursor: pointer;
  border: 1px dashed #d97706;
}

.target-date-info {
  background: linear-gradient(135deg, #d4af37 0%, #f0d264 100%);
  color: #1f2937;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.target-date-info strong {
  color: #1f2937;
}

/* Schedule Modal */
.schedule-modal {
  width: 400px;
  max-width: 90vw;
}

.schedule-modal-large {
  width: 500px;
  max-width: 95vw;
}

.schedule-modal .modal-body {
  padding: 24px;
}

.schedule-preview {
  background: #f9fafb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.schedule-preview h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.frequency-group {
  margin-bottom: 12px;
}

.frequency-group:last-child {
  margin-bottom: 0;
}

.frequency-label {
  display: inline-block;
  padding: 3px 8px;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
}

.frequency-group ul {
  margin: 0;
  padding-left: 20px;
}

.frequency-group li {
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 4px;
}

.duration-tag {
  font-size: 11px;
  color: #9ca3af;
  margin-left: 8px;
}

.schedule-settings {
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.schedule-summary {
  background: #fef3c7;
  border-radius: 8px;
  padding: 12px;
}

.schedule-summary .modal-note {
  color: #92400e;
}

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

.schedule-modal .form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.schedule-modal .form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}

.schedule-modal .form-group input:focus {
  outline: none;
  border-color: #D4AF37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.schedule-modal .modal-note {
  margin: 0;
  font-size: 13px;
  color: #9ca3af;
}

/* Research Section */
.research-section {
  padding: 16px;
}

.research-intro {
  margin-bottom: 20px;
  padding: 16px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 12px;
}

.research-intro p {
  margin: 0;
  color: #92400e;
  font-size: 14px;
}

.research-processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.research-processing h4 {
  margin: 20px 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.research-processing p {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
}

.research-messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.research-message {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.research-message.prompt {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.research-message.response {
  background: #fff;
}

.research-message-header {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.research-message.prompt .research-message-header {
  background: rgba(34, 197, 94, 0.1);
  border-bottom-color: rgba(34, 197, 94, 0.2);
}

.research-role {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.research-message.prompt .research-role {
  color: #166534;
}

.research-message-content {
  padding: 16px;
  font-size: 14px;
  line-height: 1.7;
  color: #374151;
}

.research-message-content p {
  margin: 0 0 12px;
}

.research-message-content p:last-child {
  margin-bottom: 0;
}

.research-message-content h3,
.research-message-content h4,
.research-message-content h5 {
  margin: 16px 0 8px;
  font-weight: 600;
  color: #1f2937;
}

.research-message-content h3 {
  font-size: 16px;
}

.research-message-content h4 {
  font-size: 15px;
}

.research-message-content h5 {
  font-size: 14px;
}

.research-message-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.research-message-content li {
  margin-bottom: 4px;
}

.research-message-content strong {
  color: #1f2937;
}

/* Dark Mode for Project Page */
.dark .project-page {
  background: #111827;
}

.dark .project-page-header {
  background: #1f2937;
  border-bottom-color: #374151;
}

.dark .back-to-agent-btn {
  background: #374151;
  color: #d1d5db;
}

.dark .back-to-agent-btn:hover {
  background: #4b5563;
  color: #f9fafb;
}

.dark .project-delete-btn {
  background: #374151;
  border-color: #4b5563;
  color: #9ca3af;
}

.dark .project-delete-btn:hover {
  background: #4b5563;
  border-color: #6b7280;
  color: #d1d5db;
}

.dark .project-page-title h2 {
  color: #f9fafb;
}

.dark .project-page-tabs {
  background: #1f2937;
  border-bottom-color: #374151;
}

.dark .project-tab {
  color: #9ca3af;
}

.dark .project-tab:hover {
  background: #374151;
  color: #f9fafb;
}

.dark .project-page-content {
  background: #111827;
}

.dark .project-description,
.dark .overview-section,
.dark .project-chat-item,
.dark .plan-item {
  background: #1f2937;
  border-color: #374151;
}

.dark .project-description h3,
.dark .overview-section h3,
.dark .chat-title,
.dark .plan-item-content h4 {
  color: #f9fafb;
}

.dark .project-description p,
.dark .overview-section p,
.dark .chat-prompt,
.dark .plan-item-content p {
  color: #9ca3af;
}

.dark .view-chat-btn {
  background: #374151;
  color: #d1d5db;
}

.dark .view-chat-btn:hover {
  background: #4b5563;
}

.dark .plan-item.selected {
  background: #292524;
  border-color: #D4AF37;
}

.dark .schedule-actions {
  background: #1f2937;
}

/* Dark mode for expandable plan items */
.dark .plan-item-details {
  border-top-color: #374151;
}

.dark .detail-section h5 {
  color: #e5e7eb;
}

.dark .detail-content {
  color: #9ca3af;
}

.dark .plan-item-expand-btn:hover {
  background: #374151;
  color: #d1d5db;
}

.dark .meta-tag.time-period {
  background: #312e81;
  color: #a5b4fc;
}

.dark .meta-tag.details-available {
  background: #451a03;
  color: #fbbf24;
  border-color: #d97706;
}

.dark .target-date-info {
  background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
  color: #fef3c7;
}

.dark .target-date-info strong {
  color: #fef3c7;
}

/* Dark Mode for Smart Schedule */
.dark .smart-schedule-chat {
  background: #1f2937;
  border-color: #374151;
}

.dark .smart-schedule-header {
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
}

.dark .smart-schedule-messages {
  background: #111827;
}

.dark .smart-schedule-welcome {
  color: #9ca3af;
}

.dark .smart-schedule-welcome h4 {
  color: #f9fafb;
}

.dark .smart-schedule-message.assistant .message-content {
  background: #374151;
  color: #f3f4f6;
}

.dark .schedule-day-header {
  background: #312e81;
  color: #a5b4fc;
}

.dark .schedule-time-entry {
  background: #1f2937;
  border-color: #374151;
}

.dark .schedule-time-entry .time {
  color: #818cf8;
}

.dark .schedule-time-entry .activity {
  color: #f3f4f6;
}

.dark .smart-schedule-input-area {
  background: #1f2937;
  border-top-color: #374151;
}

.dark .start-date-picker label {
  color: #d1d5db;
}

.dark .start-date-picker input[type="date"] {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

.dark .chat-input-container input[type="text"] {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

.dark .chat-input-container input[type="text"]:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

.dark .meta-tag {
  background: #374151;
  color: #d1d5db;
}

.dark .schedule-modal {
  background: #1f2937;
}

.dark .schedule-modal .form-group input {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

/* Dark Mode for Research Section */
.dark .research-intro {
  background: linear-gradient(135deg, #422006 0%, #78350f 100%);
}

.dark .research-intro p {
  color: #fde68a;
}

.dark .research-processing h4 {
  color: #f9fafb;
}

.dark .research-processing p {
  color: #9ca3af;
}

.dark .research-message {
  border-color: #374151;
}

.dark .research-message.prompt {
  background: #14532d;
  border-color: #166534;
}

.dark .research-message.response {
  background: #1f2937;
}

.dark .research-message-header {
  background: rgba(255, 255, 255, 0.05);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.dark .research-message.prompt .research-message-header {
  background: rgba(34, 197, 94, 0.15);
  border-bottom-color: rgba(34, 197, 94, 0.2);
}

.dark .research-role {
  color: #d1d5db;
}

.dark .research-message.prompt .research-role {
  color: #86efac;
}

.dark .research-message-content {
  color: #d1d5db;
}

.dark .research-message-content h3,
.dark .research-message-content h4,
.dark .research-message-content h5,
.dark .research-message-content strong {
  color: #f9fafb;
}

/* =========================================================
   HEALTH METRICS SECTION
========================================================= */

.health-metrics-section {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 16px;
}

.health-metrics-section .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.health-metrics-section .card-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.dark .health-metrics-section {
  background: transparent;
  border: none;
}

.dark .health-metrics-section .card-header h2 {
  color: #f9fafb;
}

.health-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .health-metrics-grid {
    grid-template-columns: 1fr;
  }
}

.health-metric-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s ease;
}

.health-metric-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.health-metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.health-metric-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.health-metric-icon.steps { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.health-metric-icon.distance { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.health-metric-icon.calories { background: rgba(249, 115, 22, 0.1); color: #f97316; }
.health-metric-icon.sleep { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

.health-metric-value {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}

.health-metric-unit {
  font-size: 14px;
  font-weight: 400;
  color: #6b7280;
  margin-left: 4px;
}

.health-metric-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 12px;
}

.health-metric-progress {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.health-metric-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.health-metric-progress-bar.steps { background: #3b82f6; }
.health-metric-progress-bar.distance { background: #10b981; }
.health-metric-progress-bar.calories { background: #f97316; }
.health-metric-progress-bar.sleep { background: #8b5cf6; }

.health-metric-goal {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 6px;
  text-align: right;
}

/* Health Metrics V2 - Mobile-style cards with charts */
/* Metrics Toggle Row */
.metrics-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.metrics-toggle-row {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 3px;
}

.dark .metrics-toggle-row {
  background: #374151;
}

.metrics-toggle-btn {
  padding: 10px 28px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.3px;
}

.metrics-toggle-btn:hover {
  color: #334155;
  background: rgba(255, 255, 255, 0.5);
}

.metrics-toggle-btn.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.dark .metrics-toggle-btn {
  color: #94a3b8;
}

.dark .metrics-toggle-btn:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.05);
}

.dark .metrics-toggle-btn.active {
  background: #1e293b;
  color: #f8fafc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Metrics Date Navigator */
.metrics-date-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metrics-nav-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #000000;
  transition: all 0.2s ease;
}

.metrics-nav-btn:hover {
  background: #e5e7eb;
}

.dark .metrics-nav-btn {
  background: #374151;
  color: #f8fafc;
}

.dark .metrics-nav-btn:hover {
  background: #4b5563;
}

.metrics-date {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
  min-width: 180px;
  text-align: center;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 8px;
  transition: background 0.2s ease;
}

.metrics-date:hover {
  background: #f3f4f6;
}

.dark .metrics-date {
  color: #e5e7eb;
}

/* Metric Tooltip */
.metric-tooltip {
  position: absolute;
  background: #1f2937;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  z-index: 100;
  pointer-events: none;
  transform: translateX(-50%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.metric-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1f2937;
}

.health-metrics-section {
  position: relative;
}

.health-metrics-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==========================================
   Health Journal Card Styles
   ========================================== */

.health-journal-card {
  background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.health-journal-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.dark .health-journal-card {
  background: linear-gradient(135deg, #1e293b 0%, #1f2937 100%);
  border-color: #374151;
}

.journal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.journal-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.journal-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(236, 72, 153, 0.12);
  color: #ec4899;
}

.journal-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.dark .journal-title {
  color: #f3f4f6;
}

.journal-edit-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #6b7280;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.journal-edit-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #374151;
}

.dark .journal-edit-btn {
  border-color: #4b5563;
  color: #9ca3af;
}

.dark .journal-edit-btn:hover {
  background: #374151;
  color: #e5e7eb;
}

.journal-content-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.journal-quick-prompts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.journal-prompt-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.journal-prompt-row:last-of-type {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.journal-prompt-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 70px;
  font-size: 16px;
  font-weight: 600;
  color: #000;
}

.dark .journal-prompt-label {
  color: #e2e8f0;
}

.journal-prompt-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.journal-prompt-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 90px;
}

.journal-prompt-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.journal-prompt-btn.selected {
  background: rgba(236, 72, 153, 0.15);
  border-color: #ec4899;
  color: #ec4899;
}

.journal-prompt-btn.selected .prompt-label {
  color: #ec4899;
}

.dark .journal-prompt-btn {
  background: #374151;
  border-color: #4b5563;
}

.dark .journal-prompt-btn:hover {
  background: #4b5563;
}

.prompt-emoji {
  font-size: 24px;
  line-height: 1;
}

.prompt-label {
  font-size: 13px;
  font-weight: 500;
  color: #000;
  transition: color 0.2s ease;
}

.dark .prompt-label {
  color: #e2e8f0;
}

.journal-notes-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.journal-notes-label {
  font-size: 16px;
  font-weight: 600;
  color: #000;
}

.dark .journal-notes-label {
  color: #e2e8f0;
}

.journal-notes-textarea {
  width: 100%;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 18px;
  line-height: 1.5;
  color: #000;
  resize: vertical;
  transition: all 0.2s ease;
  font-family: inherit;
}

.journal-notes-textarea:focus {
  outline: none;
  border-color: #ec4899;
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

.journal-notes-textarea::placeholder {
  color: #94a3b8;
}

.dark .journal-notes-textarea {
  background: #1f2937;
  border-color: #4b5563;
  color: #f3f4f6;
}

.dark .journal-notes-textarea:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.journal-notes-textarea.readonly {
  background: #f8fafc;
  cursor: default;
  resize: none;
}

.dark .journal-notes-textarea.readonly {
  background: #1e293b;
}

.journal-prompt-btn.readonly {
  cursor: default;
  opacity: 0.8;
}

.journal-prompt-btn.readonly:hover {
  transform: none;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.journal-prompt-btn.readonly.selected:hover {
  background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
}

.dark .journal-prompt-btn.readonly:hover {
  background: #374151;
}

.journal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
}

.journal-save-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.journal-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.journal-save-btn:active {
  transform: translateY(0);
}

.journal-saved-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #dcfce7;
  border-radius: 8px;
  color: #16a34a;
  font-size: 13px;
  font-weight: 500;
}

.dark .journal-saved-indicator {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

/* Responsive adjustments for health journal */
@media (max-width: 600px) {
  .journal-prompt-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .journal-prompt-label {
    min-width: auto;
  }

  .journal-prompt-options {
    width: 100%;
  }

  .journal-prompt-btn {
    flex: 1;
    min-width: 55px;
    padding: 6px 8px;
  }

  .prompt-emoji {
    font-size: 18px;
  }

  .prompt-label {
    font-size: 10px;
  }
}

/* ==========================================
   End Health Journal Card Styles
   ========================================== */

.health-metric-card-v2 {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 10px 16px;
  transition: all 0.2s ease;
}

.health-metric-card-v2[data-metric="sleep"] {
  margin-bottom: 12px;
}

.health-metric-card-v2:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.dark .health-metric-card-v2 {
  background: #1f2937;
  border-color: #374151;
}

.metric-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.metric-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.metric-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon-badge.steps { background: rgba(236, 72, 153, 0.12); color: #ec4899; }
.metric-icon-badge.distance { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.metric-icon-badge.calories { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.metric-icon-badge.sleep { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }

.metric-label {
  font-size: 18px;
  font-weight: 600;
  color: #374151;
}

.dark .metric-label {
  color: #e5e7eb;
}

.metric-value-group {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.metric-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.metric-value.steps { color: #ec4899; }
.metric-value.distance { color: #8b5cf6; }
.metric-value.calories { color: #f59e0b; }
.metric-value.sleep { color: #3b82f6; }

.metric-unit {
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
}

.dark .metric-unit {
  color: #9ca3af;
}

.metric-chart {
  margin: 8px 0 4px 0;
  color: #9ca3af;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.health-metric-card-v2 .metric-chart {
  border: none;
  background: transparent;
  padding: 0;
  margin: 4px 0 0 0;
  box-shadow: none;
}

.dark .metric-chart {
  color: #6b7280;
}

.metric-goal-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric-progress-mini {
  flex: 1;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}

.dark .metric-progress-mini {
  background: #374151;
}

.metric-progress-bar-mini {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.metric-progress-bar-mini.steps { background: #ec4899; }
.metric-progress-bar-mini.distance { background: #8b5cf6; }
.metric-progress-bar-mini.calories { background: #f59e0b; }
.metric-progress-bar-mini.sleep { background: #3b82f6; }

.metric-goal-text {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
}

.dark .metric-goal-text {
  color: #6b7280;
}

.sleep-log-btn-mini {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.1);
  border: none;
  border-radius: 6px;
  color: #3b82f6;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sleep-log-btn-mini:hover {
  background: rgba(59, 130, 246, 0.2);
}

/* Sleep Input Button */
.sleep-log-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 8px;
  color: #8b5cf6;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.sleep-log-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: #8b5cf6;
}

/* Sleep Input Modal */
.sleep-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.sleep-modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.sleep-modal {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.sleep-modal-overlay.visible .sleep-modal {
  transform: scale(1);
}

.sleep-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.sleep-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.sleep-modal-title svg {
  color: #8b5cf6;
}

.sleep-modal-close {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #9ca3af;
  transition: color 0.2s;
}

.sleep-modal-close:hover {
  color: #6b7280;
}

.sleep-time-picker {
  margin-bottom: 20px;
}

.sleep-time-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
}

.sleep-time-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  border-radius: 10px;
  padding: 12px;
}

.sleep-time-inputs select {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  background: #fff;
  cursor: pointer;
}

.sleep-time-inputs span {
  font-size: 18px;
  font-weight: 600;
  color: #9ca3af;
}

.sleep-duration-display {
  background: #f3f4f6;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  margin-bottom: 20px;
}

.sleep-duration-label {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 4px;
}

.sleep-duration-value {
  font-size: 24px;
  font-weight: 700;
  color: #8b5cf6;
}

.sleep-duration-value.invalid {
  color: #ef4444;
}

.sleep-modal-actions {
  display: flex;
  gap: 12px;
}

.sleep-modal-actions button {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sleep-cancel-btn {
  background: #f3f4f6;
  border: none;
  color: #6b7280;
}

.sleep-cancel-btn:hover {
  background: #e5e7eb;
}

.sleep-save-btn {
  background: #8b5cf6;
  border: none;
  color: #fff;
}

.sleep-save-btn:hover {
  background: #7c3aed;
}

.sleep-save-btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

/* Sleep Progress Bar (Mobile App Style) */
.sleep-progress-container {
  padding: 8px 0;
}

.sleep-no-data {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 12px;
}

.sleep-no-data-text {
  color: #9ca3af;
  font-size: 14px;
}

.sleep-log-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(59, 130, 246, 0.1);
  border: none;
  border-radius: 8px;
  color: #3b82f6;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sleep-log-btn:hover {
  background: rgba(59, 130, 246, 0.2);
}

.sleep-progress-bar-wrapper {
  position: relative;
  margin-bottom: 12px;
}

.sleep-progress-bar-bg {
  height: 24px;
  background: #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.sleep-progress-bar-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 12px;
  transition: width 0.3s ease;
}

.sleep-goal-marker {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.sleep-goal-text {
  font-size: 10px;
  color: #9ca3af;
  font-weight: 500;
}

.sleep-time-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sleep-time-label-left,
.sleep-time-label-right {
  display: flex;
  flex-direction: column;
}

.sleep-time-label-right {
  text-align: right;
  align-items: flex-end;
}

.sleep-time-title {
  font-size: 10px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.sleep-time-value {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

.sleep-time-date {
  font-size: 10px;
  color: #9ca3af;
}

.sleep-edit-row {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.sleep-edit-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: #3b82f6;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sleep-edit-btn:hover {
  color: #2563eb;
}

/* Sleep Timeline Layout (bedtime | progress bar | wake time) */
.sleep-timeline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.sleep-timeline-start,
.sleep-timeline-end {
  display: flex;
  flex-direction: column;
  min-width: 70px;
}

.sleep-timeline-start {
  align-items: flex-start;
  text-align: left;
}

.sleep-timeline-end {
  align-items: flex-end;
  text-align: right;
}

.sleep-timeline-label {
  font-size: 10px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.sleep-timeline-time {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

.sleep-timeline-date {
  font-size: 10px;
  color: #9ca3af;
}

.sleep-timeline .sleep-progress-bar-wrapper {
  flex: 1;
  margin-bottom: 0;
}

/* Dark mode sleep progress */
.dark .sleep-no-data-text {
  color: #6b7280;
}

.dark .sleep-log-btn {
  background: rgba(59, 130, 246, 0.15);
}

.dark .sleep-progress-bar-bg {
  background: #374151;
}

.dark .sleep-goal-text {
  color: #6b7280;
}

.dark .sleep-time-title {
  color: #6b7280;
}

.dark .sleep-time-value {
  color: #f9fafb;
}

.dark .sleep-time-date {
  color: #6b7280;
}

.dark .sleep-timeline-label {
  color: #6b7280;
}

.dark .sleep-timeline-time {
  color: #f9fafb;
}

.dark .sleep-timeline-date {
  color: #6b7280;
}

/* Dark mode health metrics */
.dark .health-metric-card {
  background: #1f2937;
  border-color: #374151;
}

.dark .health-metric-value {
  color: #f9fafb;
}

.dark .health-metric-label,
.dark .health-metric-goal {
  color: #9ca3af;
}

.dark .health-metric-progress {
  background: #374151;
}

.dark .sleep-modal {
  background: #1f2937;
}

.dark .sleep-modal-title {
  color: #f9fafb;
}

.dark .sleep-time-inputs {
  background: #374151;
}

.dark .sleep-time-inputs select {
  background: #1f2937;
  border-color: #4b5563;
  color: #f9fafb;
}

.dark .sleep-duration-display {
  background: #374151;
}

/* =========================================================
   AGENT PROJECTS SIDEBAR
========================================================= */

/* Agent layout with sidebar */
.agent-with-sidebar {
  display: flex;
  width: 100%;
  height: calc(100vh - var(--topbar-height));
}

/* Project sidebar */
.project-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.3s ease, min-width 0.3s ease;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10;
  padding-top: 48px;
}

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

/* Content area adjustment for project sidebar */
.project-sidebar ~ .content {
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s ease;
}

.project-sidebar.collapsed ~ .content {
  margin-left: var(--sidebar-collapsed-width);
}

.project-sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border-light);
}

.project-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.project-sidebar-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.project-sidebar-logo h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
}

/* New Project Button */
.new-project-btn {
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(135deg, #4b5563 0%, #1f2937 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.new-project-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(31, 41, 55, 0.3);
}

.new-project-btn svg {
  width: 18px;
  height: 18px;
}

/* Project Search */
.project-search-container {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.project-search-input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 14px;
  background: white;
  position: relative;
}

.project-search-input:focus {
  outline: none;
  border-color: #9ca3af;
  box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.1);
}

.project-search-wrapper {
  position: relative;
}

.project-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

/* Project List */
.project-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.project-list::-webkit-scrollbar {
  width: 6px;
}

.project-list::-webkit-scrollbar-track {
  background: transparent;
}

.project-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.project-list-empty {
  padding: 60px 24px;
  text-align: center;
  color: #9ca3af;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
}

.project-list-empty svg {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  color: #d1d5db;
}

.project-list-empty h4 {
  margin: 0 0 10px;
  color: #6b7280;
  font-size: 18px;
  font-weight: 600;
}

.project-list-empty p,
.project-list-empty .empty-hint {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: #9ca3af;
}

/* Project Item */
.project-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 6px;
  background: white;
  border: 1px solid transparent;
}

.project-item:hover {
  border-color: var(--border-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.project-item.active {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.project-item.active .project-item-title {
  font-weight: 600;
  color: #1f2937;
}

.project-menu-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 3px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  opacity: 0;
  transition: all 0.15s;
}

.project-item:hover .project-menu-btn {
  opacity: 1;
}

.project-menu-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

.project-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-item-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.project-item-title {
  flex: 1;
  font-size: 16px;
  font-weight: 400;
  color: #4b5563;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.2s;
}

.project-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #9ca3af;
}

.project-item-progress {
  flex: 1;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
}

.project-item-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.project-item-status {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.project-item-status.active {
  background: #ecfdf5;
  color: #059669;
}

.project-item-status.paused {
  background: #fef3c7;
  color: #d97706;
}

.project-item-status.completed {
  background: #e0f2fe;
  color: #0284c7;
}

/* =========================================================
   PROJECT DETAIL PANEL
========================================================= */

.project-detail-panel {
  width: 360px;
  min-width: 360px;
  height: 100%;
  background: white;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.project-detail-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
}

.project-detail-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.project-detail-icon {
  font-size: 32px;
}

.project-detail-actions {
  display: flex;
  gap: 8px;
}

.project-detail-actions button {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: #f3f4f6;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.project-detail-actions button:hover {
  background: #e5e7eb;
  color: #374151;
}

.project-detail-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.3;
}

.project-detail-description {
  margin: 0 0 16px;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}

/* Project Progress Bar */
.project-progress-container {
  margin-bottom: 4px;
}

.project-progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
  color: #6b7280;
}

.project-progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.project-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Project Tabs */
.project-tabs {
  display: flex;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-light);
  background: #f9fafb;
}

.project-tab {
  padding: 14px 20px;
  font-size: 18px;
  font-weight: 600;
  color: #6b7280;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.project-tab:hover {
  color: #374151;
}

.project-tab.active {
  color: #1f2937;
}

.project-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 2px;
  background: #1f2937;
  border-radius: 1px;
}

.project-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 8px;
  background: #f5f5f5;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}

.project-tab.active .project-tab-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Project Tab Content */
.project-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.project-tab-content::-webkit-scrollbar {
  width: 6px;
}

.project-tab-content::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

/* Project Messages List */
.project-message-item {
  padding: 12px;
  border-radius: 10px;
  background: #f9fafb;
  margin-bottom: 10px;
}

.project-message-item:hover {
  background: #f3f4f6;
}

.project-message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.project-message-role {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #9ca3af;
}

.project-message-role.user {
  color: #2563eb;
}

.project-message-time {
  font-size: 11px;
  color: #9ca3af;
}

.project-message-content {
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Project Events List */
.project-event-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: #f9fafb;
  margin-bottom: 10px;
}

.project-event-item:hover {
  background: #f3f4f6;
}

.project-event-status {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-event-status.completed {
  background: #d1fae5;
  color: #059669;
}

.project-event-status.pending {
  background: #e5e7eb;
  color: #9ca3af;
}

.project-event-info {
  flex: 1;
  min-width: 0;
}

.project-event-title {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-event-time {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

/* =========================================================
   PROJECT PROMPT CHIPS
========================================================= */

.project-prompts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-prompt-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.project-prompt-chip:hover {
  border-color: #9ca3af;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateX(2px);
}

.project-prompt-chip.used {
  opacity: 0.6;
  background: #f9fafb;
}

.project-prompt-chip.used:hover {
  transform: none;
  box-shadow: none;
}

.project-prompt-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.project-prompt-icon.research {
  background: #e0f2fe;
}

.project-prompt-icon.planning {
  background: #fef3c7;
}

.project-prompt-icon.motivation {
  background: #fce7f3;
}

.project-prompt-icon.tracking {
  background: #d1fae5;
}

.project-prompt-text {
  flex: 1;
  font-size: 14px;
  color: #374151;
  line-height: 1.4;
}

.project-prompt-arrow {
  color: #9ca3af;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.project-prompt-chip:hover .project-prompt-arrow {
  transform: translateX(4px);
  color: #6b7280;
}

/* =========================================================
   GOAL TEMPLATES (Quick Prompts Replacement)
========================================================= */

.goal-templates-container {
  padding: 20px;
}

.goal-templates-title {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.goal-templates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.goal-template-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.goal-template-btn:hover {
  border-color: #9ca3af;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.goal-template-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.goal-template-label {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

.goal-template-hint {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}

/* =========================================================
   AGENT CHAT WITH PROJECT CONTEXT
========================================================= */

.agent-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  overflow-y: auto;
}

.agent-main-content .chat-main {
  flex: 1;
  min-height: auto; /* Override the 100vh from base .chat-main */
}

.agent-main-content .input-box {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  background: linear-gradient(to top, #ffffff 85%, rgba(255,255,255,0));
  padding: 20px 30px 40px;
  z-index: 20;
}

/* Adjust input box when sidebar is collapsed */
.project-sidebar.collapsed ~ .content .agent-main-content .input-box,
.content.sidebar-collapsed .agent-main-content .input-box,
.content.sidebar-collapsed .input-box {
  left: var(--sidebar-collapsed-width);
}

/* Project context banner */
.project-context-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: linear-gradient(90deg, #f0fdf4 0%, #ecfdf5 100%);
  border-bottom: 1px solid #bbf7d0;
}

.project-context-icon {
  font-size: 20px;
}

.project-context-info {
  flex: 1;
}

.project-context-label {
  font-size: 11px;
  font-weight: 600;
  color: #059669;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-context-title {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

.project-context-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #059669;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-context-close:hover {
  background: rgba(5, 150, 105, 0.1);
}

/* =========================================================
   RESPONSIVE STYLES FOR PROJECTS
========================================================= */

@media (max-width: 1200px) {
  .project-detail-panel {
    width: 320px;
    min-width: 320px;
  }
}

@media (max-width: 1024px) {
  .project-sidebar {
    width: 240px;
    min-width: 240px;
  }

  .project-detail-panel {
    position: fixed;
    right: 0;
    top: var(--topbar-height);
    height: calc(100vh - var(--topbar-height));
    z-index: 100;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  }
}

@media (max-width: 768px) {
  .project-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
  }

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

  .project-detail-panel {
    width: 100%;
    min-width: 100%;
  }

  .goal-templates-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   DARK MODE FOR PROJECTS
========================================================= */

.dark .project-sidebar {
  background: #1f2937;
  border-color: #374151;
}

.dark .project-sidebar-logo h2 {
  color: #f9fafb;
}

.dark .logo-text {
  color: #f9fafb;
}

.dark .sidebar-logo h2 {
  color: #f9fafb;
}

.dark .new-project-btn {
  background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
}

.dark .project-search-input {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

.dark .project-item {
  background: #374151;
}

.dark .project-item:hover {
  border-color: #4b5563;
}

.dark .project-item.active {
  background: #4b5563;
  border-color: #6b7280;
}

.dark .project-item-title {
  color: #9ca3af;
}

.dark .project-item.active .project-item-title {
  color: #f9fafb;
  font-weight: 600;
}

.dark .project-menu-btn:hover {
  background: #4b5563;
  color: #e5e7eb;
}

.dark .project-detail-panel {
  background: #1f2937;
  border-color: #374151;
}

.dark .project-detail-title {
  color: #f9fafb;
}

.dark .project-tabs {
  background: #111827;
  border-color: #374151;
}

.dark .project-tab {
  color: #9ca3af;
}

/* Dark mode for agent sidebar elements */
.dark .sidebar-section-header {
  color: #9ca3af;
}

.dark .sidebar-nav-item {
  background: #374151;
}

.dark .sidebar-nav-item:hover {
  background: #4b5563;
}

.dark .sidebar-nav-title {
  color: #f9fafb;
}

.dark .sidebar-nav-title-large {
  color: #f9fafb;
}

.dark .sidebar-nav-subtitle {
  color: #9ca3af;
}

/* Dark mode for agent history modal */
.dark .agent-history-modal {
  background: #1f2937;
}

.dark .agent-history-modal .modal-header {
  border-color: #374151;
}

.dark .agent-history-modal .modal-header h2 {
  color: #f9fafb;
}

.dark .agent-history-modal .modal-close {
  background: #374151;
  color: #9ca3af;
}

.dark .agent-history-modal .modal-close:hover {
  background: #4b5563;
  color: #f9fafb;
}

.dark .agent-history-item {
  background: #374151;
  border-color: transparent;
}

.dark .agent-history-item:hover {
  background: #4b5563;
  border-color: #6b7280;
}

.dark .agent-history-item-title {
  color: #f9fafb;
}

.dark .agent-history-item-date {
  color: #9ca3af;
}

.dark .agent-history-item-preview {
  color: #d1d5db;
}

.dark .agent-history-item-preview.empty {
  color: #6b7280;
}

.dark .agent-history-item-meta {
  color: #9ca3af;
}

.dark .search-highlight {
  background: #854d0e;
  color: #fef08a;
}

.dark .agent-history-empty {
  color: #9ca3af;
}

.dark .agent-history-empty h4 {
  color: #f9fafb;
}

.dark .project-tab:hover {
  color: #d1d5db;
}

.dark .project-tab.active {
  color: #f9fafb;
}

.dark .project-tab.active::after {
  background: #f9fafb;
}

.dark .project-prompt-chip {
  background: #374151;
  border-color: #4b5563;
}

.dark .project-prompt-text {
  color: #e5e7eb;
}

.dark .goal-template-btn {
  background: #374151;
  border-color: #4b5563;
}

.dark .goal-template-label {
  color: #f9fafb;
}

/* =========================================================
   PROJECT SCHEDULE TAB STYLES
========================================================= */

.project-schedule-content {
  max-width: 900px;
  margin: 0 auto;
}

/* Schedule Header Box */
.schedule-header-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.schedule-header-info h3 {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}

.schedule-duration {
  margin: 0;
  font-size: 15px;
  color: #6b7280;
}

.schedule-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.schedule-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.schedule-btn.edit-btn {
  background: #f5f5f5;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.schedule-btn.edit-btn:hover {
  background: #ebebeb;
  border-color: #d1d5db;
}

.schedule-btn.confirm-btn {
  background: linear-gradient(135deg, #D4AF37 0%, #C9A227 100%);
  color: white;
  box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

.schedule-btn.confirm-btn:hover {
  background: linear-gradient(135deg, #C9A227 0%, #B8931F 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
}

.schedule-btn.confirm-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.schedule-btn.reschedule-btn {
  background: #D4A853;
  color: white;
  border: none;
  padding: 10px 16px;
  font-size: 15px;
  margin-top: 0;
}

.schedule-btn.reschedule-btn:hover {
  background: #c49a48;
}

.schedule-btn.save-btn {
  background: #1a1a1a;
  color: white;
}

.schedule-btn.save-btn:hover {
  background: #333;
}

.schedule-btn.cancel-btn {
  background: transparent;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

.schedule-btn.cancel-btn:hover {
  background: #f5f5f5;
  color: #374151;
}

.schedule-confirmed-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #F0FDF4;
  color: #166534;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid #BBF7D0;
}

/* Schedule Editor Box */
.schedule-editor-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.schedule-editor {
  width: 100%;
  min-height: 450px;
  padding: 24px;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.8;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  resize: vertical;
  background: #f9fafb;
  color: #1a1a1a;
}

.schedule-editor:focus {
  outline: none;
  border-color: #D4AF37;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.schedule-edit-actions {
  display: flex;
  gap: 14px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #f3f4f6;
}

/* Schedule Display Box */
.schedule-display-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.schedule-display-box p {
  font-size: 17px;
  line-height: 1.8;
  color: #374151;
  margin: 0 0 16px 0;
}

.schedule-week-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 32px 0 20px 0;
  padding: 16px 20px;
  background: #f9fafb;
  border-radius: 10px;
  border-left: 4px solid #D4AF37;
}

.schedule-week-header:first-child {
  margin-top: 0;
}

.schedule-item {
  padding: 14px 20px;
  margin: 10px 0;
  color: #374151;
  font-size: 17px;
  line-height: 1.7;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid #f3f4f6;
  transition: all 0.15s ease;
}

.schedule-item:hover {
  background: #FDFCF9;
  border-color: #D4AF37;
  transform: translateX(4px);
}

.schedule-item strong {
  color: #1a1a1a;
}

/* Markdown Table Styles (chat messages) */
.md-table-wrapper {
  margin: 16px 0;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.md-table th,
.assistant-content .md-table th,
.message.assistant .md-table th {
  background: #f3f4f6;
  color: #1f2937 !important;
  font-weight: 700;
  text-align: left;
  padding: 12px 14px;
  font-size: 13px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.md-table th a,
.assistant-content .md-table th a {
  color: #1f2937 !important;
  text-decoration: none;
}

.md-table th:first-child {
  border-top-left-radius: 11px;
}

.md-table th:last-child {
  border-top-right-radius: 11px;
}

.md-table thead {
  border-bottom: 2px solid #d1d5db;
}

.md-table td,
.assistant-content .md-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
  vertical-align: top;
}

.md-table tbody tr:hover {
  background: #f9fafb;
}

.md-table tbody tr:last-child td {
  border-bottom: none;
}

.md-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 11px;
}

.md-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 11px;
}

/* Schedule Table Styles */
.schedule-table-wrapper {
  margin: 24px 0;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.schedule-table th {
  background: #1a1a1a;
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 14px 16px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.schedule-table th:first-child {
  border-top-left-radius: 11px;
}

.schedule-table th:last-child {
  border-top-right-radius: 11px;
}

.schedule-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
  vertical-align: top;
}

.schedule-table tbody tr:hover {
  background: #f9fafb;
}

.schedule-table tbody tr:last-child td {
  border-bottom: none;
}

.schedule-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 11px;
}

.schedule-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 11px;
}

.schedule-table .total-row {
  background: #f9fafb;
  font-weight: 600;
}

.schedule-table .total-row td {
  color: #1a1a1a;
  border-top: 2px solid #D4AF37;
}

/* Schedule Title Row - contains title and action buttons */
.schedule-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

/* Schedule Title Header */
.schedule-title-header {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

/* Schedule Inline Actions - buttons above schedule content */
.schedule-inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

/* Schedule Divider */
.schedule-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 20px 0;
}

/* Schedule Paragraph */
.schedule-paragraph {
  font-size: 17px;
  line-height: 1.7;
  color: #374151;
  margin: 0 0 12px 0;
}

/* Schedule Note (checkmark items) - plain text list */
.schedule-item.schedule-note {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 8px 0;
  margin: 4px 0;
  color: #374151;
  font-size: 17px;
}

.schedule-item.schedule-note:hover {
  background: transparent;
  border: none;
  transform: none;
}

/* Editable Schedule Styles */
.schedule-display-box.editing {
  border-color: #D4AF37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.schedule-content.editable {
  min-height: 400px;
  outline: none;
  cursor: text;
}

.schedule-content.editable:focus {
  outline: none;
}

.schedule-content.editable .schedule-week-header {
  cursor: text;
}

.schedule-content.editable .schedule-item {
  cursor: text;
}

.schedule-content.editable .schedule-item:hover {
  transform: none;
}

/* =========================================================
   PROJECT GUIDES TAB STYLES
========================================================= */

.project-guides-content {
  max-width: 900px;
  margin: 0 auto;
}

.project-guides-content h3 {
  font-size: 22px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 10px 0;
}

.guides-description {
  font-size: 18px;
  color: #6b7280;
  margin: 0 0 28px 0;
  line-height: 1.6;
}

.guides-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.guide-download-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 28px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  width: 100%;
  text-align: left;
  font: inherit;
}

.guide-download-item:hover {
  border-color: #D4AF37;
  background: #FDFCF9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.guide-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.guide-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.guide-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-filename {
  font-size: 14px;
  color: #6b7280;
}

.guide-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #f5f5f5;
  border-radius: 12px;
  color: #6b7280;
  flex-shrink: 0;
  transition: all 0.2s;
}

.guide-download-item:hover .guide-download-btn {
  background: #D4AF37;
  color: white;
}

/* Confirmed badge */
.confirmed-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #F8F6F0;
  color: #8B7355;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #E8DFC6;
}

/* =========================================================
   DARK MODE - SCHEDULE & GUIDES
========================================================= */

.dark .project-schedule-content .schedule-actions,
.dark .schedule-display {
  background: #1f2937;
  border-color: #374151;
}

.dark .schedule-editor {
  background: #1f2937;
  border-color: #374151;
  color: #f9fafb;
}

.dark .schedule-week-header {
  color: #f9fafb;
  border-bottom-color: #374151;
}

.dark .schedule-item {
  border-left-color: #374151;
  color: #d1d5db;
}

.dark .schedule-item:hover {
  background: #374151;
}

.dark .schedule-confirmed-notice {
  background: #064e3b;
  color: #a7f3d0;
  border-color: #065f46;
}

.dark .project-guides-content h3 {
  color: #f9fafb;
}

.dark .guide-download-item {
  background: #1f2937;
  border-color: #374151;
}

.dark .guide-download-item:hover {
  background: #374151;
  border-color: #6366f1;
}

.dark .guide-title {
  color: #f9fafb;
}

.dark .guide-download-btn {
  background: #374151;
  color: #818cf8;
}

.dark .guide-download-item:hover .guide-download-btn {
  background: #6366f1;
  color: white;
}


/* =========================================================
   VOICE INTERACTION (Speech-to-Text & Text-to-Speech)
========================================================= */

/* Voice Input Button (Microphone) */
.voice-input-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: #6b7280;
  transition: all 0.2s;
  margin-right: 4px;
}

.voice-input-btn:hover {
  background: #f3f4f6;
  color: var(--primary);
}

.voice-input-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

/* Recording state - pulsing animation */
.voice-input-btn.listening {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
  animation: pulse-recording 1.5s ease-in-out infinite;
}

.voice-input-btn.listening:hover {
  background: rgba(220, 38, 38, 0.2);
  color: #dc2626;
}

@keyframes pulse-recording {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
  }
}

.voice-input-btn.transcribing {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  animation: pulse-transcribing 1s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse-transcribing {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Speak Message Button (Text-to-Speech) */
.speak-message-btn {
  background: transparent;
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.speak-message-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #111827;
}

.speak-message-btn svg {
  stroke: currentColor;
  fill: none;
}

/* Speaking state - active animation */
.speak-message-btn.speaking {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  animation: pulse-speaking 1s ease-in-out infinite;
}

.speak-message-btn.speaking:hover {
  background: rgba(99, 102, 241, 0.2);
}

.speak-message-btn.active {
  color: #9ca3af;
}

@keyframes pulse-speaking {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Dark mode styles for voice buttons */
.dark .voice-input-btn {
  color: #9ca3af;
}

.dark .voice-input-btn:hover {
  background: #374151;
  color: #818cf8;
}

.dark .voice-input-btn.listening {
  color: #f87171;
  background: rgba(248, 113, 113, 0.2);
}

.dark .voice-input-btn.listening:hover {
  background: rgba(248, 113, 113, 0.3);
}

.dark .speak-message-btn {
  color: #9ca3af;
}

.dark .speak-message-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f9fafb;
}

.dark .speak-message-btn.speaking {
  color: #818cf8;
  background: rgba(129, 140, 248, 0.2);
}

.dark .speak-message-btn.speaking:hover {
  background: rgba(129, 140, 248, 0.3);
}

/* =========================================================
   HEALTH INSIGHTS PAGE STYLES
========================================================= */

.insights-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px;
}

.insights-header {
  margin-bottom: 24px;
}

.insights-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text-main);
}

.insights-header .subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0 0 4px 0;
}

.insights-header .data-range {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.insights-summary {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 15px;
  color: #166534;
}

.dark .insights-summary {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
  border-color: rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.insights-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.insights-loading {
  text-align: center;
  padding: 60px 20px;
}

.insights-loading .loading-spinner {
  font-size: 16px;
  color: var(--text-secondary);
}

/* Insights Sections */
.insights-section {
  margin-bottom: 32px;
}

.insights-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text-main);
}

.insights-section .section-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
}

/* Insights Grid */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Insight Card */
.insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.insight-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.insight-card.high {
  border-left: 4px solid #10b981;
}

.insight-card.medium {
  border-left: 4px solid #f59e0b;
}

.insight-card.low {
  border-left: 4px solid #9ca3af;
}

.insight-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.insight-method {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.insight-confidence {
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
}

.insight-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-main);
  margin: 0 0 8px 0;
}

.insight-recommendation {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

/* No Insights Message */
.no-insights-message {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.no-insights-message svg {
  margin-bottom: 16px;
}

.no-insights-message h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text-main);
}

.no-insights-message p {
  font-size: 14px;
  margin: 0;
  max-width: 400px;
  margin: 0 auto;
}

/* Correlation Heatmap */
.heatmap-container {
  overflow-x: auto;
}

.correlation-heatmap {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.correlation-heatmap th,
.correlation-heatmap td {
  padding: 12px 16px;
  text-align: center;
  border: 1px solid var(--border-light);
}

.correlation-heatmap thead th {
  background: var(--bg-sidebar);
  font-weight: 600;
  color: var(--text-main);
}

.correlation-heatmap tbody th {
  background: var(--bg-sidebar);
  font-weight: 500;
  text-align: left;
  color: var(--text-main);
}

.heatmap-cell {
  min-width: 80px;
  font-weight: 500;
  transition: transform 0.1s;
}

.heatmap-cell:hover {
  transform: scale(1.05);
}

.heatmap-cell.empty {
  color: var(--text-secondary);
  background: var(--bg-sidebar);
}

.heatmap-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

/* Mood Tracking Section */
.mood-tracking-section {
  margin-top: 32px;
}

.mood-tracking-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 640px) {
  .mood-tracking-card {
    flex-direction: row;
    align-items: flex-start;
  }
}

.mood-today {
  flex: 1;
}

.mood-current,
.mood-not-logged {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mood-emoji {
  font-size: 40px;
}

.mood-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.mood-sublabel {
  font-size: 13px;
  color: var(--text-secondary);
}

.mood-trend {
  margin-top: 12px;
  font-size: 14px;
}

.trend-up {
  color: #10b981;
  font-weight: 500;
}

.trend-down {
  color: #ef4444;
  font-weight: 500;
}

.trend-stable {
  color: var(--text-secondary);
}

.mood-chart {
  flex: 1;
}

.mood-chart h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--text-main);
}

.mood-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 120px;
  gap: 8px;
}

.mood-bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.mood-bar {
  width: 100%;
  max-width: 30px;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.3s;
}

.mood-bar-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Button Styles */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-secondary);
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.loading-spinner-small {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Dark mode for insights */
.dark .insight-card {
  background: #1f2937;
  border-color: #374151;
}

.dark .insight-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark .correlation-heatmap th,
.dark .correlation-heatmap td {
  border-color: #374151;
}

.dark .correlation-heatmap thead th,
.dark .correlation-heatmap tbody th {
  background: #1f2937;
}

.dark .heatmap-cell.empty {
  background: #1f2937;
}

/* =========================================================
   UNIFIED HEALTH INSIGHTS PAGE
========================================================= */

.health-insights-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

/* Modern Health Insights Header */
.health-insights-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

/* View Toggle Pills (Day/Week) */
.view-toggle-pills {
  display: flex;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.toggle-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.25s ease;
  letter-spacing: 0.3px;
}

.toggle-pill:hover {
  color: #334155;
  background: rgba(255, 255, 255, 0.5);
}

.toggle-pill.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Modern Date Selector */
.date-selector-modern {
  display: flex;
  align-items: center;
  gap: 12px;
}

.date-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  cursor: pointer;
  color: #000000;
  transition: all 0.2s ease;
}

.date-arrow:hover {
  background: #e5e7eb;
}

.date-arrow:active {
  transform: scale(0.95);
}

.date-picker-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 20px;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 180px;
  font-size: 18px;
  font-weight: 600;
  color: #374151;
}

.date-picker-btn:hover {
  background: var(--bg-hover);
}

.date-picker-btn .date-day {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.date-picker-btn .date-main {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 1px;
}

.date-display {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-main);
  min-width: 100px;
  text-align: center;
  transition: all 0.15s;
}

.date-display:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

/* Loading state */
.health-insights-loading {
  display: flex;
  justify-content: center;
  padding: 60px 20px;
}

/* Section Cards */
.insights-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
}

.section-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-sidebar);
}

.section-card-header .section-icon {
  font-size: 20px;
}

.section-card-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text-main);
}

.section-card-header .section-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 2px 0 0 0;
}

.section-card-header .btn-icon {
  margin-left: auto;
}

.section-card-content {
  padding: 20px;
}

/* Time Balance Section */
/* Events Summary Section (AI-generated schedule description) */
.events-summary-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.daily-insights-card .events-summary-section {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.events-summary-section .events-summary-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-main);
}

.events-summary-section .events-summary-text strong {
  color: var(--primary);
  font-weight: 600;
}

.dark .events-summary-section {
  border-bottom-color: #374151;
}

.dark .events-summary-section .events-summary-text strong {
  color: #60a5fa;
}

.time-balance-section {
  margin-bottom: 16px;
}

.time-balance-section h4 {
  font-size: 15px;
  font-weight: 600;
  color: #000;
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.balance-legend.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.balance-legend.compact .balance-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  color: #000;
}

/* Insight Observation */
.insight-observation {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--bg-sidebar);
  border-radius: 8px;
  margin-top: 16px;
}

.observation-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.observation-content {
  flex: 1;
}

.observation-content strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text-main);
}

.observation-content p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.observation-content .suggestion {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-light);
  font-style: italic;
}

/* Events & Health Metrics Summary */
.events-summary,
.health-metrics-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  font-size: 14px;
}

.events-summary {
  border-bottom: 1px solid var(--border-light);
}

.events-label,
.metrics-label {
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 60px;
}

.events-value,
.metrics-value {
  color: var(--text-main);
}

/* AI Analysis Box */
.ai-analysis-box {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 10px;
}

.ai-analysis-box.weekly {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border-color: #c4b5fd;
}

.ai-analysis-box.loading,
.ai-analysis-box.pending {
  background: var(--bg-sidebar);
  border-color: var(--border-light);
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.ai-analysis-box .missing-hint,
.ai-analysis-box .loading-hint {
  font-size: 12px;
  color: var(--primary-color);
  margin-top: 8px;
  opacity: 0.9;
}

.ai-analysis-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 16px;
  color: #1e3a8a;
}

.ai-analysis-box.weekly .ai-analysis-header {
  color: #6d28d9;
}

.ai-icon {
  font-size: 16px;
}

.ai-summary {
  font-size: 17px;
  line-height: 1.6;
  margin: 0 0 12px 0;
  color: #1e3a5f;
}

.ai-analysis-box.weekly .ai-summary,
.ai-analysis-box.weekly p {
  color: #3b0764;
}

/* Event Impacts */
.event-impacts {
  margin: 12px 0;
}

.impact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 15px;
}

.impact-row.positive .impact-icon {
  color: #10b981;
}

.impact-row.negative .impact-icon {
  color: #ef4444;
}

.impact-row.neutral .impact-icon {
  color: #9ca3af;
}

.impact-event {
  font-weight: 500;
  color: var(--text-main);
}

.impact-note {
  color: var(--text-secondary);
  font-size: 14px;
}

.ai-suggestion {
  margin: 12px 0 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 17px;
  line-height: 1.6;
  color: #0c4a6e;
}

/* Correlation Insights */
.correlation-insights {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}

.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-sidebar);
  border-radius: 8px;
  border-left: 3px solid var(--border-color);
  transition: background 0.2s;
}

.insight-item:hover {
  background: var(--bg-hover);
}

.insight-item.positive {
  border-left-color: #10b981;
}

.insight-item.negative {
  border-left-color: #ef4444;
}

.insight-item.neutral {
  border-left-color: #6b7280;
}

.insight-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.insight-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.insight-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-main);
}

.insight-finding {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-main);
}

/* Correlation Rows */
.correlation-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.correlation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-sidebar);
  border-radius: 8px;
  font-size: 18px;
}

.correlation-row.positive {
  border-left: 3px solid #10b981;
}

.correlation-row.negative {
  border-left: 3px solid #ef4444;
}

.correlation-activity {
  font-weight: 500;
  color: var(--text-main);
}

.correlation-metric {
  color: #000;
  flex: 1;
  text-align: center;
}

.correlation-impact {
  font-size: 17px;
  font-weight: 600;
  min-width: 70px;
  text-align: center;
  padding: 6px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.05);
}

.correlation-row.positive .correlation-impact {
  color: #166534;
  background: #dcfce7;
}

.correlation-row.negative .correlation-impact {
  color: #991b1b;
  background: #fee2e2;
}

.correlation-explanation {
  font-size: 14px;
  color: #374151;
  padding: 6px 16px 12px;
  margin-top: -4px;
  line-height: 1.5;
}

/* Correlation Sections */
.correlation-section {
  margin-bottom: 20px;
}

.correlation-section:last-child {
  margin-bottom: 0;
}

.correlation-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Time Effects (Optimal Timing) */
.time-effects {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.time-effect-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-sidebar);
  border-radius: 8px;
  font-size: 16px;
}

.time-effect-icon {
  font-weight: 600;
  color: var(--text-main);
  min-width: 80px;
}

.time-effect-text {
  flex: 1;
  color: #374151;
}

.time-effect-badge {
  font-size: 15px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.time-effect-badge.positive {
  background: #dcfce7;
  color: #166534;
}

.time-effect-badge.negative {
  background: #fee2e2;
  color: #991b1b;
}

/* Dark mode for correlation sections */
.dark .correlation-section-title {
  color: #f9fafb;
}

.dark .time-effect-row {
  background: #1f2937;
}

.dark .time-effect-icon {
  color: #f9fafb;
}

.dark .time-effect-text {
  color: #d1d5db;
}

.dark .time-effect-badge.positive {
  background: #065f46;
  color: #6ee7b7;
}

.dark .time-effect-badge.negative {
  background: #7f1d1d;
  color: #fca5a5;
}

/* Week Overview - Day Dots */
.week-overview {
  margin-bottom: 20px;
}

.day-dots-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.day-dot-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.day-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: transform 0.2s ease;
  cursor: default;
}

.day-dot:hover {
  transform: scale(1.15);
}

.day-dot.good {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.day-dot.okay {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.day-dot.bad {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.day-dot.unknown {
  background: var(--bg-sidebar);
  border: 2px dashed var(--border-light);
  box-shadow: none;
}

.day-dot-label {
  font-size: 14px;
  font-weight: 600;
  color: #000;
}

/* Week at a Glance Legend */
.week-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #000;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.good {
  background: #10b981;
}

.legend-dot.okay {
  background: #f59e0b;
}

.legend-dot.bad {
  background: #ef4444;
}

.legend-dot.unknown {
  background: var(--bg-sidebar);
  border: 1.5px dashed var(--border-light);
}

.dark .week-legend {
  border-top-color: #374151;
}

.dark .legend-dot.unknown {
  background: #374151;
  border-color: #4b5563;
}

/* Chart legend for Weekly Trends */
.chart-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.chart-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #000;
}

.chart-legend .legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dark .chart-legend {
  border-top-color: #374151;
}

/* Weekly Trends with Sparklines */
.trends-section {
  margin-bottom: 20px;
}

.trends-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.trend-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.trend-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.trend-arrow {
  font-size: 17px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 14px;
}

.trend-arrow.up {
  background: #dcfce7;
  color: #166534;
}

.trend-arrow.down {
  background: #fee2e2;
  color: #991b1b;
}

.trend-arrow.stable {
  background: #f3f4f6;
  color: #6b7280;
}

.sparkline {
  width: 100%;
  height: 24px;
  display: block;
}

.sparkline-chart {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 8px;
}

/* Improved trend item styling */
.trend-item {
  background: var(--bg-sidebar);
  border-radius: 12px;
  padding: 14px 16px;
}

/* Sparkline dot hover */
.sparkline-chart .dot-group {
  cursor: pointer;
}

.sparkline-chart .dot-hitarea {
  fill: transparent;
}

.sparkline-chart .sparkline-tooltip {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.sparkline-chart .dot-group:hover .sparkline-tooltip {
  opacity: 1;
}

.sparkline-chart .dot-group:hover .sparkline-dot-highlight {
  opacity: 1;
}

.trend-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.trend-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.trend-arrow {
  font-size: 17px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.trend-arrow.up {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #047857;
}

.trend-arrow.down {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #b91c1c;
}

.trend-arrow.stable {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #6b7280;
}

/* Dark mode for week overview */
.dark .day-dot.unknown {
  background: #374151;
  border-color: #4b5563;
}

.dark .day-dot-label {
  color: #9ca3af;
}

.dark .trend-item {
  background: #1f2937;
}

.dark .trend-label {
  color: #f9fafb;
}

.dark .trend-arrow.up {
  background: #065f46;
  color: #6ee7b7;
}

.dark .trend-arrow.down {
  background: #7f1d1d;
  color: #fca5a5;
}

.dark .trend-arrow.stable {
  background: #374151;
  color: #9ca3af;
}


/* Best/Worst Days */
.best-worst-days {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.day-highlight {
  flex: 1;
  padding: 14px;
  border-radius: 8px;
  font-size: 18px;
}

.day-highlight.best {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #86efac;
}

.day-highlight.worst {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #fca5a5;
}

.day-label {
  display: block;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.day-highlight.best .day-label {
  color: #166534;
}

.day-highlight.worst .day-label {
  color: #991b1b;
}

.day-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
}

.day-reason {
  display: block;
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Patterns Summary */
.patterns-summary {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.insights-grid.compact {
  gap: 12px;
}

.insights-grid.compact .insight-card {
  padding: 12px 14px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-link:hover {
  text-decoration: underline;
}

/* No Data Message */
.no-data-message {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Date Picker Modal */
.date-picker-modal {
  max-width: 300px;
  padding: 20px;
}

.date-picker-modal h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
}

.date-picker-modal input[type="date"] {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  margin-bottom: 16px;
}

.date-picker-modal .modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Insights Modal */
.insights-modal {
  max-width: 700px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.insights-modal .modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.insights-modal .modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
  line-height: 1;
}

.insights-modal .modal-body {
  padding: 20px;
  overflow-y: auto;
}

/* Dark mode for Health Insights */
.dark .health-insights-page .insights-section-card {
  background: #1f2937;
  border-color: #374151;
}

.dark .section-card-header {
  background: #111827;
  border-color: #374151;
}

/* Dark mode - Modern Health Insights Header */
.dark .health-insights-header {
  background: #1f2937;
}

.dark .view-toggle-pills {
  background: #111827;
}

.dark .toggle-pill {
  color: #9ca3af;
}

.dark .toggle-pill:hover {
  background: #374151;
  color: #f9fafb;
}

.dark .toggle-pill.active {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border: 2px solid #ec4899;
}

.dark .date-arrow,
.dark .date-picker-btn {
  background: #111827;
  color: #f9fafb;
}

.dark .date-arrow:hover,
.dark .date-picker-btn:hover {
  background: #374151;
}

.dark .date-picker-btn .date-day {
  color: #60a5fa;
}

.dark .date-picker-btn .date-main {
  color: #f9fafb;
}

.dark .insight-observation {
  background: #1f2937;
}

.dark .time-balance-section h4 {
  color: #f9fafb;
}

.dark .balance-legend.compact .balance-legend-item {
  color: #f9fafb;
}

.dark .correlation-row {
  background: #1f2937;
}

.dark .correlation-impact {
  background: rgba(255, 255, 255, 0.1);
}

.dark .correlation-row.positive .correlation-impact {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.2);
}

.dark .correlation-row.negative .correlation-impact {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.2);
}

.dark .correlation-explanation {
  color: #e5e7eb;
}

.dark .correlation-metric {
  color: #e5e7eb;
}

.dark .ai-analysis-box {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
  border-color: #3b82f6;
}

.dark .ai-analysis-header {
  color: #60a5fa;
}

.dark .ai-summary,
.dark .ai-suggestion {
  color: #e0f2fe;
}

.dark .ai-analysis-box.weekly {
  background: linear-gradient(135deg, #2e1065 0%, #1e1b4b 100%);
  border-color: #8b5cf6;
}

.dark .ai-analysis-box.weekly .ai-analysis-header {
  color: #a78bfa;
}

.dark .ai-analysis-box.weekly .ai-summary,
.dark .ai-analysis-box.weekly p {
  color: #ede9fe;
}

.dark .day-highlight.best {
  background: linear-gradient(135deg, #14532d 0%, #166534 100%);
  border-color: #22c55e;
}

.dark .day-highlight.worst {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
  border-color: #ef4444;
}

.dark .day-highlight .day-label {
  color: inherit;
  opacity: 0.8;
}

.dark .day-name,
.dark .day-reason {
  color: #f9fafb;
}

.dark .date-picker-modal input[type="date"] {
  background: #1f2937;
  border-color: #374151;
  color: #f9fafb;
}

.dark .mood-tracking-card {
  background: #1f2937;
  border-color: #374151;
}

.dark .btn-secondary {
  background: #1f2937;
  border-color: #374151;
  color: #f9fafb;
}

.dark .btn-secondary:hover {
  background: #374151;
}

/* Daily Summary Section */
.daily-summary-section {
  margin-top: 32px;
}

.daily-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
}

.daily-summary-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.daily-summary-content .summary-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-main);
  margin: 0;
}

.daily-summary-content .summary-text strong,
.daily-summary-content .summary-text b {
  color: var(--primary);
  font-weight: 600;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  flex-shrink: 0;
}

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

.btn-icon.spinning svg {
  animation: spin 0.8s linear infinite;
}

.daily-summary-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
}

.daily-summary-empty p {
  margin: 0 0 12px 0;
  font-size: 14px;
}

.btn-small {
  padding: 8px 14px;
  font-size: 13px;
}

.dark .daily-summary-card {
  background: #1f2937;
  border-color: #374151;
}

.dark .btn-icon {
  border-color: #374151;
}

.dark .btn-icon:hover {
  background: #374151;
}

/* =========================================================
   DAILY SUMMARY PAGE STYLES
========================================================= */

.daily-summary-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px;
}

.daily-summary-page .page-header {
  margin-bottom: 24px;
}

.daily-summary-page .page-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text-main);
}

.daily-summary-page .page-header .subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
}

.summaries-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  transition: box-shadow 0.2s;
}

.summary-card:hover {
  box-shadow: var(--shadow-md);
}

.summary-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.summary-card .summary-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-main);
}

/* Formatted summary with icons */
.summary-formatted {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-formatted.summary-loading .summary-item {
  animation: pulse 1.5s ease-in-out infinite;
}

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

.summary-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-sidebar);
  border-radius: 8px;
  transition: background 0.2s;
}

.summary-item:hover {
  background: var(--bg-hover);
}

.item-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.item-text {
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-main);
}

/* Highlighted keywords */
.summary-item .highlight {
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.15) 0%, rgba(37, 99, 235, 0.1) 100%);
  color: var(--primary);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

/* Metrics (numbers with units) */
.summary-item .metric {
  background: linear-gradient(120deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.1) 100%);
  color: #059669;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

/* Dark mode for formatted summary */
.dark .summary-item {
  background: rgba(255, 255, 255, 0.03);
}

.dark .summary-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.dark .summary-item .highlight {
  background: rgba(96, 165, 250, 0.2);
  color: #93c5fd;
}

.dark .summary-item .metric {
  background: rgba(52, 211, 153, 0.2);
  color: #6ee7b7;
}

.no-summaries {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.no-summaries svg {
  margin-bottom: 16px;
}

.no-summaries h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text-main);
}

.no-summaries p {
  font-size: 14px;
  margin: 0;
  max-width: 400px;
  margin: 0 auto;
}

.subscription-required {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

/* Dark mode */
.dark .summary-card {
  background: #1f2937;
  border-color: #374151;
}

.dark .summary-date {
  border-bottom-color: #374151;
}

/* =========================================================
   DAILY NEWS PAGE STYLES
========================================================= */

.daily-news-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px;
}

.daily-news-page .page-header {
  margin-bottom: 24px;
}

.daily-news-page .page-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text-main);
}

.daily-news-page .page-header .subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  transition: box-shadow 0.2s;
}

.news-card:hover {
  box-shadow: var(--shadow-md);
}

.news-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 10px;
}

.news-headline {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main);
  margin: 0 0 12px 0;
}

.news-summary {
  font-size: 18px;
  line-height: 1.7;
  color: #000;
  margin: 0 0 16px 0;
}

.news-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.news-source {
  font-size: 12px;
  color: var(--text-secondary);
}

.news-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.2s;
}

.news-link:hover {
  opacity: 0.8;
}

.no-news {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.no-news svg {
  margin-bottom: 16px;
}

.no-news h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text-main);
}

.no-news p {
  font-size: 14px;
  margin: 0;
}

/* Dark mode */
.dark .news-card {
  background: #1f2937;
  border-color: #374151;
}

.dark .news-footer {
  border-top-color: #374151;
}

/* Summary loading animation */
.summary-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}


/* Food Logs Section */
.food-logs-section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: none;
}

.food-logs-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.food-logs-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.food-logs-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.food-logs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  color: #9ca3af;
  text-align: center;
  gap: 4px;
}

.food-logs-hint {
  font-size: 12px;
  color: #d1d5db;
}

.food-logs-totals {
  display: flex;
  justify-content: space-around;
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 12px;
}

.food-total-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.food-total-value {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.food-total-label {
  font-size: 11px;
  color: #9ca3af;
  text-transform: uppercase;
}

.food-logs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.food-log-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}

.food-log-item:last-child {
  border-bottom: none;
}

.food-log-time {
  font-size: 12px;
  color: #9ca3af;
  min-width: 65px;
  padding-top: 4px;
}

.food-log-content {
  display: flex;
  gap: 12px;
  flex: 1;
}

.food-log-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
}

.food-log-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.food-log-foods {
  font-size: 16px;
  font-weight: 500;
  color: #1f2937;
  line-height: 1.4;
}

.food-log-macros {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  margin-top: 4px;
}

.food-log-calories {
  color: #f97316;
  font-weight: 600;
}

.food-log-macro {
  color: #6b7280;
}

/* Dark mode food logs */
.dark .food-logs-section {
  background: #1f2937;
}

.dark .food-logs-title {
  color: #f9fafb;
}

.dark .food-logs-empty {
  color: #6b7280;
}

.dark .food-logs-hint {
  color: #4b5563;
}

.dark .food-logs-totals {
  border-bottom-color: #374151;
}

.dark .food-total-value {
  color: #f9fafb;
}

.dark .food-total-label {
  color: #6b7280;
}

.dark .food-log-item {
  border-bottom-color: #374151;
}

.dark .food-log-time {
  color: #6b7280;
}

.dark .food-log-foods {
  color: #f9fafb;
}

.dark .food-log-macro {
  color: #9ca3af;
}
