/**
 * Alphalabs Trading Dashboard - v2.5 PRO Notion-Inspired Theme
 * =============================================================
 * Professional matte dark theme inspired by Notion's design language
 * Supports both light and dark modes via CSS variables
 */

/* ===== CSS VARIABLES ===== */
:root {
  /* Light Mode Palette (Notion-inspired) */
  --bg: #FFFFFF;
  --sidebar: #F7F7F5;
  --hover: #EFEFEF;
  --border: #E1E1E1;
  --text: #37352F;
  --muted: #787774;
  --block: #FFFFFF;
  --overlay: #FFFFFFcc;

  /* Accent Colors (shared) */
  --notion-blue: #4E7CFF;
  --notion-red: #FF5C5C;
  --notion-green: #4CAF50;
  --notion-yellow: #D9B310;
  --notion-purple: #8B5CF6;
  --notion-teal: #14B8A6;
  --notion-orange: #F97316;
}

.dark, html.dark, body.dark {
  /* Dark Mode Palette (Professional Matte) */
  --bg: #0F0F0F;
  --sidebar: #141414;
  --hover: #2A2A2A;
  --border: rgba(255, 255, 255, 0.08);
  --text: #EAEAEA;
  --muted: #888888;
  --block: #1A1A1A;
  --overlay: rgba(21, 21, 21, 0.6);
}

/* ===== TYPOGRAPHY ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

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

html, body {
  height: 100%;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

/* Display font for headlines */
.font-display {
  font-family: 'Space Grotesk', sans-serif;
}

/* Monospace for data/numbers */
.font-mono {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--muted);
  opacity: 0.5;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text);
}

.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

/* ===== LAYOUT COMPONENTS ===== */

/* Main App Container */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: var(--bg);
  color: var(--text);
  overflow: hidden;
  position: relative;
}

@supports (min-height: 100dvh) {
  .app-container {
    min-height: 100dvh;
  }
}

/* Sidebar */
.sidebar {
  width: 256px;
  background-color: var(--sidebar);
  border-right: 1px solid var(--border);
  height: 100vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  transition: transform 0.3s ease-in-out;
}

@supports (height: 100dvh) {
  .sidebar {
    height: 100dvh;
  }
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

@media (max-width: 1024px) {
  .sidebar {
    width: min(88vw, 340px);
    height: 100dvh;
    padding-top: max(0.25rem, env(safe-area-inset-top));
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 65;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45);
  }

  /* Ensure sidebar footer is always visible on mobile */
  .sidebar-nav {
    max-height: calc(100dvh - 220px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); /* Account for header + footer */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    margin-top: 0;
  }

  .sidebar-footer {
    position: sticky;
    bottom: 0;
    background-color: var(--sidebar);
    z-index: 10;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  }

  /* Improve mobile touch targets for sidebar footer items */
  .sidebar-footer-item {
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* Sidebar Brand */
.sidebar-brand {
  padding: 0;
  margin: 0;
  margin-bottom: 0;
}

.sidebar-brand-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  min-height: auto;
}

.sidebar-brand-inner {
  cursor: default;
  pointer-events: none;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

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

/* Mobile responsive - smaller logo */
@media (max-width: 768px) {
  .sidebar-brand {
    padding: 0.35rem 0.5rem 0.2rem;
    margin: 0.25rem 0.5rem 0.5rem;
  }

  .sidebar-brand-inner {
    min-height: 88px;
    padding: 0.35rem 0.25rem;
  }

  .sidebar-logo img {
    height: 100px !important;
    width: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
  }
}

.sidebar-logo svg {
  width: 20px;
  height: 20px;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.sidebar-brand-tagline {
  font-size: 9px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 2px;
  opacity: 0.7;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.35rem 0.75rem;
  min-height: 0; /* Important for flexbox scrolling */
}

@media (max-width: 1024px) {
  .sidebar-nav {
    margin-top: 0;
    padding: 0.35rem 0.75rem 0.8rem;
  }
  .sidebar-nav-item {
    padding: 0.30rem 0.75rem;
  }
}

.sidebar-nav-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.3rem 0.75rem 0.2rem;
  margin-bottom: 0.1rem;
  font-family: 'JetBrains Mono', monospace;
  opacity: 0.7;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.02em;
  color: var(--muted);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
}

.sidebar-nav-item:hover {
  background-color: var(--hover);
  color: var(--text);
}

.sidebar-nav-item.active {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  font-weight: 500;
  border-color: rgba(59, 130, 246, 0.2);
}

.sidebar-nav-item.active .nav-icon {
  color: #3b82f6;
}

.sidebar-nav-item .nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.mu-nav-market-updates {
  position: relative;
}

.mu-nav-market-updates-unread {
  color: var(--text);
  border-color: rgba(59, 130, 246, 0.22);
  background: rgba(59, 130, 246, 0.08);
}

.mu-nav-unread-pill {
  margin-left: auto;
  height: 18px;
  min-width: 36px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  flex-shrink: 0;
  pointer-events: none;
}

.mu-nav-market-updates-pulse {
  animation: mu-navPulseRing 2.8s ease-out 1;
}

@keyframes mu-navPulseRing {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.38);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(59, 130, 246, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

.app-fixed-footer {
  pointer-events: none;
  z-index: 15;
}

@media (max-width: 640px) {
  .app-fixed-footer {
    display: none;
  }
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  background-color: rgba(42, 42, 42, 0.1);
  flex-shrink: 0; /* Prevent footer from shrinking */
}

.sidebar-footer-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--muted);
  transition: all 0.2s ease;
}

.sidebar-footer-item:hover {
  background-color: var(--hover);
  color: var(--text);
}

.sidebar-footer-item.logout:hover {
  color: #ef4444;
}

.sidebar-footer-item .nav-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  margin-left: 256px;
  transition: margin-left 0.3s ease;
}

@supports (min-height: 100dvh) {
  .main-content {
    min-height: 100dvh;
  }
}

@media (max-width: 1024px) {
  .main-content {
    margin-left: 0;
  }
}

/* Top Bar */
.top-bar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
  font-family: 'Space Grotesk', sans-serif;
}

.top-bar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.top-bar-breadcrumb-divider {
  opacity: 0.3;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  background-color: var(--hover);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid var(--border);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22c55e;
}

.top-bar-btn {
  position: relative;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
}

.top-bar-btn:hover {
  background-color: var(--hover);
  color: var(--text);
}

/* Mobile-specific touch target improvements */
@media (max-width: 640px) {
  .top-bar-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0.625rem;
  }
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  background-color: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(239, 68, 68, 0.8);
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  padding: 0.5rem;
  margin-left: -0.5rem;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
  background-color: var(--hover);
  color: var(--text);
}

@media (max-width: 1024px) {
  .mobile-menu-btn {
    display: flex;
  }
}

/* Dashboard Content */
.dashboard-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem;
  gap: 1.25rem;
}

.dashboard-shell {
  height: calc(100vh - 96px);
}

@supports (height: 100dvh) {
  .dashboard-shell {
    height: calc(100dvh - 96px);
  }
}

@media (max-width: 1024px) {
  .dashboard-shell {
    height: auto;
    min-height: calc(100dvh - 64px);
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  }
}

@media (max-width: 640px) {
  .dashboard-shell {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
    gap: 0.65rem;
  }

  .dashboard-panel {
    border-radius: 1rem;
  }

  .dashboard-panel-macro {
    height: 420px !important;
  }

  .dashboard-panel-news {
    height: 500px !important;
  }

  .dashboard-panel-calendar,
  .dashboard-panel-notes {
    height: 320px !important;
  }
}

/* Dashboard Header */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  margin-bottom: 0.5rem;
}

.dashboard-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dashboard-title h1 {
  font-size: 1.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.version-badge {
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
}

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

/* Block Base Styles */
.block {
  background-color: var(--overlay);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.block:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Block Header */
.block-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--block);
}

.block-header-left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.block-header-icon {
  padding: 0.375rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.block-header-icon.blue {
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.block-header-icon.teal {
  background-color: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.2);
  color: #14b8a6;
}

.block-header-icon.red {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.block-header-icon.yellow {
  background-color: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.2);
  color: #eab308;
}

.block-title {
  font-size: 0.875rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.block-content {
  padding: 1rem;
}

/* ===== COUNTDOWN BLOCK ===== */
.countdown-block {
  grid-column: span 3;
  position: relative;
}

.countdown-block .block-inner {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.countdown-block .glow {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 128px;
  height: 128px;
  background: rgba(59, 130, 246, 0.1);
  filter: blur(50px);
  border-radius: 50%;
  pointer-events: none;
  transition: background 0.7s ease;
}

.countdown-block:hover .glow {
  background: rgba(59, 130, 246, 0.2);
}

.countdown-label {
  font-size: 10px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  background-color: rgba(59, 130, 246, 0.1);
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(59, 130, 246, 0.2);
  display: inline-block;
  margin-bottom: 1rem;
}

.countdown-time {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(59, 130, 246, 0.3);
}

.countdown-event {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.countdown-event-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.countdown-currency {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.875rem;
  color: #60a5fa;
  background-color: rgba(59, 130, 246, 0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

.countdown-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.02em;
}

.countdown-time-local {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  opacity: 0.6;
  margin-top: 0.5rem;
}

/* Auto Badge */
.auto-badge {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.auto-badge-text {
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  color: #22c55e;
  opacity: 0.8;
}

.auto-badge-dot {
  width: 6px;
  height: 6px;
  background-color: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
  animation: pulse 2s infinite;
}

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

/* ===== EVENTS LIST BLOCK ===== */
.events-block {
  grid-column: span 3;
}

.events-block .block-content {
  padding: 0.75rem;
  overflow-y: auto;
  max-height: 300px;
}

.event-item {
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background-color: var(--block);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.event-item:hover {
  background-color: var(--hover);
  border-color: rgba(255, 255, 255, 0.12);
}

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

.event-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.event-currency {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #14b8a6;
  background-color: rgba(20, 184, 166, 0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(20, 184, 166, 0.2);
}

.event-time {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
}

.event-name {
  font-size: 0.75rem;
  font-weight: 500;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text);
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.event-item:hover .event-name {
  color: #3b82f6;
}

.event-impact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.event-impact-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.event-impact-dot.high {
  background-color: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.event-impact-dot.medium {
  background-color: #eab308;
}

.event-impact-dot.low {
  background-color: #22c55e;
}

.event-impact-text {
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ===== NEWS FEED BLOCK ===== */
.news-block {
  grid-column: span 6;
}

.news-block .block-content {
  padding: 0;
  max-height: 500px;
  overflow-y: auto;
}

.news-item {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.news-item:hover {
  background-color: var(--hover);
}

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

.news-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.news-timestamp {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
}

.news-breaking {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 9px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(239, 68, 68, 0.2);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.news-headline {
  font-size: 0.875rem;
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.5;
  color: var(--text);
  transition: color 0.2s ease;
}

.news-item:hover .news-headline {
  color: #60a5fa;
}

.news-headline.urgent {
  font-weight: 500;
}

.news-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.2s ease;
}

.news-item:hover .news-actions {
  opacity: 1;
  transform: translateY(0);
}

.news-action-link {
  font-size: 10px;
  font-weight: 500;
  color: #3b82f6;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.news-action-link:hover {
  color: #60a5fa;
}

/* News Loading State */
.news-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 0.5rem;
}

.news-loading-spinner {
  animation: spin 1s linear infinite;
  color: #3b82f6;
}

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

.news-loading-text {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: #3b82f6;
}

/* ===== TRADING PREP BLOCK ===== */
.prep-block {
  grid-column: span 3;
}

.prep-block .block-inner {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.prep-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.prep-datetime {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--block);
  border: 1px solid var(--border);
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.prep-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.prep-time {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #3b82f6;
  background-color: rgba(59, 130, 246, 0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

.prep-add-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 0.375rem 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prep-add-btn:hover {
  background-color: var(--hover);
  color: var(--text);
}

.prep-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

/* Trend Section */
.prep-trend {
  background-color: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  position: relative;
  overflow: hidden;
}

.prep-trend .glow {
  position: absolute;
  top: 0;
  right: 0;
  width: 128px;
  height: 128px;
  background: rgba(59, 130, 246, 0.1);
  filter: blur(48px);
  border-radius: 50%;
  margin-right: -40px;
  margin-top: -40px;
  pointer-events: none;
}

.prep-trend-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.prep-trend-icon {
  padding: 0.25rem;
  background-color: rgba(59, 130, 246, 0.1);
  border-radius: 50%;
  margin-top: 2px;
}

.prep-trend-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.prep-trend-data {
  padding-left: 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.prep-trend-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.prep-trend-label {
  width: 64px;
  font-weight: 600;
}

.prep-trend-label.strong {
  color: #22c55e;
}

.prep-trend-label.weak {
  color: #ef4444;
}

.prep-trend-value {
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
}

.prep-trend-direction {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-left: 0.25rem;
}

.prep-trend-direction.up {
  color: #22c55e;
}

.prep-trend-direction.down {
  color: #ef4444;
}

/* Advice Section */
.prep-advice {
  background-color: rgba(234, 179, 8, 0.05);
  border: 1px solid rgba(234, 179, 8, 0.2);
  border-radius: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 1.5rem;
}

.prep-advice-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.prep-advice-icon {
  padding: 0.25rem;
  background-color: rgba(234, 179, 8, 0.1);
  border-radius: 50%;
  margin-top: 2px;
}

.prep-advice-text {
  font-size: 0.75rem;
  font-weight: 500;
  color: #ca8a04;
  line-height: 1.5;
}

.dark .prep-advice-text {
  color: #fbbf24;
}

.prep-advice-text .green {
  color: #22c55e;
  font-weight: 700;
}

.prep-advice-text .red {
  color: #ef4444;
  font-weight: 700;
}

/* Empty Notes State */
.prep-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 80px;
  border: 1px dashed var(--border);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.prep-empty:hover {
  background-color: var(--hover);
  border-color: var(--text);
}

.prep-empty-text {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease;
}

.prep-empty:hover .prep-empty-text {
  color: var(--text);
}

.prep-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

/* ===== QUICK NOTE BLOCK ===== */
.notes-block {
  grid-column: span 3;
}

.notes-block .block-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.notes-list {
  flex: 1;
  background-color: rgba(26, 26, 26, 0.4);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.5rem;
  margin-bottom: 0.75rem;
  overflow-y: auto;
  max-height: 200px;
  position: relative;
}

.notes-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
}

.notes-empty-icon {
  margin-bottom: 0.5rem;
  color: var(--muted);
}

.notes-empty-text {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-style: italic;
  color: var(--muted);
  text-align: center;
}

.notes-empty-subtext {
  font-size: 9px;
  color: var(--muted);
  opacity: 0.5;
  margin-top: 0.25rem;
}

.note-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  margin-bottom: 0.25rem;
}

.note-item:hover {
  background-color: var(--hover);
  border-color: var(--border);
}

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

.note-check-btn {
  margin-top: 2px;
  color: var(--muted);
  opacity: 0.5;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.note-check-btn:hover {
  color: #22c55e;
  opacity: 1;
}

.note-content {
  flex: 1;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.5;
  word-break: break-word;
  color: var(--text);
}

.note-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

.note-time {
  font-size: 9px;
  color: var(--muted);
  opacity: 0.4;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.note-item:hover .note-time {
  opacity: 1;
}

.note-delete-btn {
  opacity: 0;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.note-item:hover .note-delete-btn {
  opacity: 1;
}

.note-delete-btn:hover {
  color: #ef4444;
}

.notes-input-wrapper {
  display: flex;
  gap: 0.5rem;
  position: relative;
}

.notes-input {
  flex: 1;
  background-color: var(--block);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  padding-right: 2.5rem;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  transition: all 0.2s ease;
}

.notes-input::placeholder {
  color: var(--muted);
}

.notes-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  background-color: var(--hover);
}

.notes-send-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.25rem;
  background-color: #3b82f6;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  color: white;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.notes-send-btn:hover {
  background-color: #60a5fa;
}

/* ===== MOBILE BACKDROP ===== */
.mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 40;
}

@media (max-width: 1024px) {
  body.sidebar-open {
    overflow: hidden;
    touch-action: none;
  }
}

@supports selector(body:has(.sidebar.open)) {
  @media (max-width: 1024px) {
    body:has(.sidebar.open) {
      overflow: hidden;
      touch-action: none;
    }
  }
}

@media (max-width: 1024px) {
  .mobile-backdrop.active {
    display: block;
  }
}

/* Discord popup motion */
@keyframes dc-overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes dc-card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dc-overlay-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes dc-card-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

@keyframes dc-float-smooth {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes dc-glow-smooth {
  0%, 100% {
    box-shadow: 0 0 18px rgba(88, 101, 242, 0.28), 0 10px 24px rgba(0, 0, 0, 0.38);
  }
  50% {
    box-shadow: 0 0 28px rgba(88, 101, 242, 0.45), 0 14px 30px rgba(0, 0, 0, 0.42);
  }
}

#dc-overlay {
  animation: dc-overlay-in 180ms cubic-bezier(0.22, 1, 0.36, 1) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#dc-overlay.dc-closing {
  pointer-events: none;
  animation: dc-overlay-out 180ms ease-out forwards !important;
}

#dc-card {
  transform-origin: center center;
  will-change: transform, opacity;
  animation: dc-card-in 320ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#dc-card.dc-closing {
  pointer-events: none;
  animation: dc-card-out 220ms cubic-bezier(0.4, 0, 1, 1) forwards !important;
}

#dc-icon {
  will-change: transform;
  animation: dc-float-smooth 4.2s cubic-bezier(0.37, 0, 0.63, 1) infinite !important;
}

#dc-icon-inner {
  animation: dc-glow-smooth 3.2s ease-in-out infinite !important;
}

@media (prefers-reduced-motion: reduce) {
  #dc-overlay,
  #dc-card,
  #dc-icon,
  #dc-icon-inner {
    animation: none !important;
  }
}

/* ============================================
   iPAD & TABLET SPECIFIC FIXES (notion-theme)
   ============================================ */

/* iPad Landscape (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Sidebar is hidden, adjust main content */
  .main-content {
    margin-left: 0;
    width: 100%;
  }

  /* Dashboard content padding for tablet */
  .dashboard-content {
    padding: 1rem;
    gap: 1rem;
  }

  /* Dashboard grid - 2 column layout for tablet */
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  /* Block sizing for tablet */
  .countdown-block,
  .events-block,
  .prep-block,
  .notes-block {
    grid-column: span 1;
  }

  .news-block {
    grid-column: span 2;
  }

  /* Top bar adjustments */
  .top-bar {
    padding: 0 1rem;
    height: 52px;
  }

  .top-bar-right {
    gap: 0.5rem;
  }

  /* Block content adjustments */
  .block-content {
    padding: 0.875rem;
  }

  .block-header {
    padding: 0.875rem 1rem;
  }

  /* Events block height fix */
  .events-block .block-content {
    max-height: 280px;
  }

  /* Notes list height fix */
  .notes-list {
    max-height: 180px;
  }

  /* Countdown styling for tablet */
  .countdown-time {
    font-size: clamp(2rem, 4vw, 3rem);
  }

  /* Improve touch targets */
  .sidebar-nav-item,
  .sidebar-footer-item {
    padding: 0.625rem 0.875rem;
    min-height: 44px;
  }

  /* Event item touch improvements */
  .event-item {
    padding: 0.875rem;
  }

  /* Note item touch improvements */
  .note-item {
    padding: 0.625rem;
  }
}

/* iPad Portrait (600px - 768px) */
@media (min-width: 600px) and (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
  }

  .countdown-block,
  .events-block {
    grid-column: span 1;
  }

  .prep-block,
  .notes-block,
  .news-block {
    grid-column: span 2;
  }

  .dashboard-content {
    padding: 0.875rem;
  }

  /* Reduce block padding on smaller tablets */
  .block-content {
    padding: 0.75rem;
  }

  .countdown-time {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
  }
}

/* General tablet fixes */
@media (max-width: 1024px) {
  /* Prevent iOS zoom on input focus */
  input, select, textarea {
    font-size: 16px !important;
  }

  .top-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding-top: env(safe-area-inset-top);
    min-height: calc(56px + env(safe-area-inset-top));
  }

  /* Ensure proper scrolling on iOS */
  .dashboard-content,
  .events-block .block-content,
  .news-block .block-content,
  .notes-list {
    -webkit-overflow-scrolling: touch;
  }

  /* Fix horizontal overflow */
  .app-container {
    overflow-x: hidden;
  }

  /* Better status badge on tablet */
  .status-badge {
    padding: 0.375rem 0.625rem;
    font-size: 11px;
  }

  /* Make breadcrumb more compact on tablet */
  .top-bar-breadcrumb {
    font-size: 0.8rem;
  }
}

/* ===== MOBILE HEADER OPTIMIZATION ===== */
@media (max-width: 640px) {
  .top-bar {
    padding: 0 0.75rem;
    height: auto;
    min-height: calc(56px + env(safe-area-inset-top));
  }

  .top-bar-left {
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
  }

  .top-bar-breadcrumb {
    font-size: 0.875rem;
    min-width: 0;
  }

  .top-bar-breadcrumb span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-bar-right {
    gap: 0.375rem;
    flex-shrink: 0;
  }

  /* Compact mobile menu button */
  .mobile-menu-btn {
    padding: 0.375rem;
    margin-left: -0.375rem;
  }

  /* Hide DATA LIVE badge on mobile to save space */
  .status-badge {
    display: none !important;
  }

  /* Compact trial badge on mobile */
  .trial-badge {
    padding: 6px 8px;
    font-size: 10px;
    gap: 4px;
  }

  /* Ensure touch targets are adequate for mobile */
  .top-bar-btn {
    min-width: 40px;
    min-height: 40px;
  }

  /* Reduce separator visibility */
  .top-bar-right .h-4 {
    display: none;
  }
}

/* Extra small screens - further optimizations */
@media (max-width: 380px) {
  .top-bar {
    padding: 0 0.5rem;
  }

  .top-bar-left {
    gap: 0.375rem;
  }

  .top-bar-right {
    gap: 0.25rem;
  }

  .upgrade-btn {
    padding: 5px 10px;
    font-size: 11px;
  }

  .upgrade-btn-text {
    font-size: 10px;
  }

  .trial-badge {
    padding: 5px 7px;
    font-size: 9px;
  }
}

/* ===== RESPONSIVE GRID ADJUSTMENTS ===== */
@media (max-width: 1280px) {
  .countdown-block,
  .events-block,
  .prep-block,
  .notes-block {
    grid-column: span 6;
  }

  .news-block {
    grid-column: span 12;
  }
}

@media (max-width: 768px) {
  .countdown-block,
  .events-block,
  .prep-block,
  .notes-block,
  .news-block {
    grid-column: span 12;
  }

  .dashboard-content {
    padding: 1rem;
  }
}

/* ===== SCHEDULE EVENT ITEM ===== */
.schedule-event-item {
  padding: 0.75rem;
  border-radius: 0.5rem;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.schedule-event-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}

.schedule-event-item .delete-form {
  margin-top: 0.5rem;
}

.schedule-event-item .delete-form button {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.schedule-event-item .delete-form button:hover {
  background: rgba(239, 68, 68, 0.2);
}

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

/* Calendar grid layout */
.weekly-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.875rem;
  margin-bottom: 2rem;
  animation: calendarFadeIn 0.4s ease-in;
}

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

/* Calendar day card */
.calendar-day {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--block);
  padding: 1rem;
  min-height: 350px;
  max-height: 600px;
  overflow-y: auto;
  overflow-x: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Custom scrollbar for day cards */
.calendar-day::-webkit-scrollbar {
  width: 6px;
}

.calendar-day::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.calendar-day::-webkit-scrollbar-thumb {
  background: rgba(0, 217, 255, 0.3);
  border-radius: 3px;
}

.calendar-day::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 217, 255, 0.5);
}

/* Day card hover effect */
.calendar-day:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 217, 255, 0.3);
}

/* Today highlight */
.calendar-day.today {
  border: 2px solid #00d9ff;
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.15), rgba(0, 136, 255, 0.08));
  box-shadow: 0 0 40px rgba(0, 217, 255, 0.25), 0 8px 16px rgba(0, 0, 0, 0.15);
}

.calendar-day.today:hover {
  box-shadow: 0 0 50px rgba(0, 217, 255, 0.35), 0 12px 24px rgba(0, 0, 0, 0.2);
}

/* Weekend styling */
.calendar-day.weekend {
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.03), rgba(255, 51, 102, 0.02));
  border-color: rgba(255, 179, 0, 0.15);
}

/* Day header */
.calendar-day-header {
  font-weight: 700;
  text-align: center;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  position: relative;
}

/* Event item card */
.calendar-event-item {
  padding: 0.75rem;
  border-radius: 8px;
  border-left: 4px solid #00d9ff;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.05));
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

/* Event item shine effect on hover */
.calendar-event-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.calendar-event-item:hover::before {
  left: 100%;
}

/* Event item hover state */
.calendar-event-item:hover {
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.12), rgba(0, 136, 255, 0.06));
  transform: translateX(4px) scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), -4px 0 8px rgba(0, 217, 255, 0.2);
}

/* Event item active state */
.calendar-event-item:active {
  transform: translateX(2px) scale(0.99);
}

/* Light mode calendar styles */
html:not(.dark) .calendar-day {
  background: #ffffff;
  border-color: #e5e7eb;
}

html:not(.dark) .calendar-day:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

html:not(.dark) .calendar-day.today {
  background: linear-gradient(135deg, rgba(0, 136, 204, 0.08), rgba(0, 102, 170, 0.04));
  border-color: #0088cc;
}

html:not(.dark) .calendar-event-item {
  background: linear-gradient(135deg, rgba(0, 136, 204, 0.05), rgba(0, 102, 170, 0.02));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

html:not(.dark) .calendar-event-item:hover {
  background: linear-gradient(135deg, rgba(0, 136, 204, 0.1), rgba(0, 102, 170, 0.05));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), -4px 0 8px rgba(0, 136, 204, 0.15);
}

/* Calendar Responsive Design */
@media (max-width: 1400px) {
  .weekly-calendar {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 1200px) {
  .weekly-calendar {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
  }

  .calendar-day {
    min-height: 300px;
  }
}

@media (max-width: 900px) {
  .weekly-calendar {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .weekly-calendar {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
  }

  .calendar-day {
    min-height: 250px;
    padding: 0.75rem;
  }

  .calendar-event-item {
    padding: 0.625rem;
  }
}

@media (max-width: 480px) {
  .weekly-calendar {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .calendar-day {
    min-height: auto;
    max-height: 500px;
  }

  .calendar-event-item {
    padding: 0.75rem;
  }
}

/* ===== LIGHT MODE COMPONENT OVERRIDES ===== */

/* Financial News Feed - Light Mode */
html:not(.dark) .financial-news-feed {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

html:not(.dark) .financial-news-feed h2 {
  color: #1f2937 !important;
}

html:not(.dark) .financial-news-feed .news-header button {
  background: rgba(37, 99, 235, 0.1) !important;
  border: 1px solid rgba(37, 99, 235, 0.3) !important;
  color: #2563eb !important;
}

html:not(.dark) .financial-news-feed .news-header span {
  color: #6b7280 !important;
}

html:not(.dark) .financial-news-feed .news-item {
  background: #f9fafb !important;
  border-color: #e5e7eb !important;
}

html:not(.dark) .financial-news-feed .news-item.critical {
  background: rgba(239, 68, 68, 0.08) !important;
  border-left-color: #ef4444 !important;
}

html:not(.dark) .financial-news-feed .news-item h3 {
  color: #111827 !important;
}

html:not(.dark) .financial-news-feed .news-item span {
  color: #4b5563 !important;
}

html:not(.dark) .financial-news-feed .news-item strong {
  color: #0891b2 !important;
}

/* Todo Card (Data Trading Preparation) - Light Mode */
html:not(.dark) [class*="bg-slate-900"],
html:not(.dark) [class*="bg-slate-800"],
html:not(.dark) [class*="bg-slate-700"] {
  background-color: #ffffff !important;
}

html:not(.dark) [class*="from-slate-800"],
html:not(.dark) [class*="to-slate-700"] {
  background: linear-gradient(to bottom, #f3f4f6, #e5e7eb) !important;
}

html:not(.dark) [class*="text-slate-100"] {
  color: #1f2937 !important;
}

html:not(.dark) [class*="text-slate-300"] {
  color: #4b5563 !important;
}

html:not(.dark) [class*="text-slate-400"] {
  color: #6b7280 !important;
}

html:not(.dark) [class*="border-slate-700"],
html:not(.dark) [class*="border-slate-600"] {
  border-color: #d1d5db !important;
}

html:not(.dark) [class*="bg-indigo-500/10"] {
  background-color: rgba(99, 102, 241, 0.12) !important;
}

html:not(.dark) [class*="border-indigo-500/30"] {
  border-color: rgba(99, 102, 241, 0.4) !important;
}

html:not(.dark) [class*="text-indigo-200"],
html:not(.dark) [class*="text-indigo-400"] {
  color: #4338ca !important;
}

html:not(.dark) [class*="bg-amber-500/10"] {
  background-color: rgba(245, 158, 11, 0.12) !important;
}

html:not(.dark) [class*="border-amber-500/30"] {
  border-color: rgba(245, 158, 11, 0.4) !important;
}

html:not(.dark) [class*="text-amber-200"],
html:not(.dark) [class*="text-amber-400"],
html:not(.dark) [class*="text-amber-500"] {
  color: #b45309 !important;
}

html:not(.dark) [class*="text-emerald-400"],
html:not(.dark) [class*="text-emerald-300"] {
  color: #059669 !important;
}

html:not(.dark) [class*="text-red-400"],
html:not(.dark) [class*="text-red-300"] {
  color: #dc2626 !important;
}

/* Input fields in light mode */
html:not(.dark) input[class*="bg-slate-800"],
html:not(.dark) select[class*="bg-slate-800"] {
  background-color: #f9fafb !important;
  border-color: #d1d5db !important;
  color: #1f2937 !important;
}

html:not(.dark) input::placeholder {
  color: #9ca3af !important;
}

/* Form backgrounds */
html:not(.dark) [class*="bg-slate-800/50"],
html:not(.dark) [class*="bg-slate-800/70"] {
  background-color: #f3f4f6 !important;
}

/* Quick Notes & Warnings - Light Mode */
html:not(.dark) #notes-root h3[class*="text-slate-100"] {
  color: #111827 !important;
  font-weight: 700 !important;
}

html:not(.dark) #notes-root [class*="text-slate-100"] {
  color: #1f2937 !important;
}

html:not(.dark) #notes-root [class*="bg-amber-900/20"] {
  background-color: rgba(245, 158, 11, 0.12) !important;
}

html:not(.dark) #notes-root [class*="border-amber-700/50"] {
  border-color: rgba(217, 119, 6, 0.4) !important;
}

/* Scratchpad card styling for light mode */
html:not(.dark) .scratchpad-card,
html:not(.dark) [class*="bg-notion-block"] {
  background-color: #ffffff !important;
  border-color: #e5e7eb !important;
}

/* Calendar in light mode improvements */
html:not(.dark) #calendar-root [class*="bg-slate"],
html:not(.dark) #calendar-root [class*="bg-[#"] {
  background-color: #f9fafb !important;
}

html:not(.dark) #calendar-root [class*="text-slate"] {
  color: #374151 !important;
}

html:not(.dark) #calendar-root [class*="text-teal"],
html:not(.dark) #calendar-root [class*="text-[#5eead4]"] {
  color: #0d9488 !important;
}

html:not(.dark) #calendar-root [class*="border-teal"],
html:not(.dark) #calendar-root [style*="border"][style*="teal"] {
  border-color: #14b8a6 !important;
}

/* General slate color overrides for light mode */
html:not(.dark) .bg-slate-900\/70,
html:not(.dark) .bg-\[radial-gradient\(circle\,rgba\(255\,255\,255\,0\.06\)_1px\,transparent_1px\)\] {
  background: #ffffff !important;
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.04) 1px, transparent 1px) !important;
  background-size: 10px 10px !important;
}

/* Week calendar light mode */
html:not(.dark) #calendar-root > div {
  background-color: transparent !important;
}

html:not(.dark) #calendar-root [style*="background: #1e293b"],
html:not(.dark) #calendar-root [style*="background:#1e293b"] {
  background-color: #f3f4f6 !important;
}

html:not(.dark) #calendar-root [style*="border: 1px solid #334155"],
html:not(.dark) #calendar-root [style*="border:1px solid #334155"] {
  border-color: #d1d5db !important;
}

html:not(.dark) #calendar-root [style*="color: #cbd5e1"],
html:not(.dark) #calendar-root [style*="color:#cbd5e1"] {
  color: #374151 !important;
}

html:not(.dark) #calendar-root [style*="color: #64748b"],
html:not(.dark) #calendar-root [style*="color:#64748b"] {
  color: #6b7280 !important;
}

html:not(.dark) #calendar-root [style*="color: #94a3b8"],
html:not(.dark) #calendar-root [style*="color:#94a3b8"] {
  color: #4b5563 !important;
}

html:not(.dark) #calendar-root [style*="color: #e2e8f0"],
html:not(.dark) #calendar-root [style*="color:#e2e8f0"] {
  color: #1f2937 !important;
}

/* Month calendar grid light mode */
html:not(.dark) #calendar-root [style*="background: #334155"] {
  background-color: #e5e7eb !important;
}

html:not(.dark) #calendar-root [style*="background: #0f172a"] {
  background-color: #f9fafb !important;
}

/* ===== UTILITY CLASSES ===== */
.text-notion-text { color: var(--text); }
.text-notion-muted { color: var(--muted); }
.bg-notion-bg { background-color: var(--bg); }
.bg-notion-block { background-color: var(--block); }
.bg-notion-hover { background-color: var(--hover); }
.bg-notion-sidebar { background-color: var(--sidebar); }
.border-notion-border { border-color: var(--border); }

/* ===== PROFILE DROPDOWN ===== */
.profile-dropdown-container {
  position: relative;
}
.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}
.profile-btn:hover {
  background: var(--hover);
}
.profile-btn svg {
  color: var(--muted);
}
.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: var(--sidebar);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}
.profile-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.profile-name {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}
.profile-email {
  font-size: 12px;
  color: var(--muted);
}
.profile-dropdown-badge {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.sub-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.sub-badge.pro {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.sub-badge.trial {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.sub-badge.expired {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}
.sub-badge.free {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}
.profile-dropdown-footer {
  padding: 12px 16px;
}
.profile-logout-btn {
  display: block;
  width: 100%;
  padding: 10px;
  text-align: center;
  background: var(--hover);
  color: var(--text);
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s;
}
.profile-logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* ============================================
   UPGRADE BUTTON (Top Banner)
   ============================================ */
.upgrade-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border: 1px solid #dc2626;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
}

.upgrade-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
}

.upgrade-btn:hover::before {
  left: 100%;
}

.upgrade-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.2),
              0 0 30px rgba(220, 38, 38, 0.3);
  border-color: #ef4444;
}

.upgrade-btn:active {
  transform: translateY(0);
}

.upgrade-btn svg {
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
}

.upgrade-btn-text {
  white-space: nowrap;
  font-size: 11px;
}

.upgrade-btn-badge {
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  font-size: 9px;
  font-weight: 700;
  color: #000;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

.upgrade-btn.pulse {
  animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.15),
                0 0 0 0 rgba(220, 38, 38, 0.6);
  }
  50% {
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.15),
                0 0 0 8px rgba(220, 38, 38, 0);
  }
}

/* Mobile-optimized upgrade button with visible text */
@media (max-width: 640px) {
  .upgrade-btn {
    padding: 6px 12px;
    font-size: 12px;
    gap: 4px;
  }

  .upgrade-btn svg {
    width: 12px;
    height: 12px;
  }

  .upgrade-btn-text {
    display: inline;
    font-size: 11px;
    font-weight: 600;
  }

  .upgrade-btn-badge {
    display: none;
  }
}

/* ============================================
   UPGRADE MODAL
   ============================================ */
.upgrade-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.upgrade-modal.active {
  opacity: 1;
}

.upgrade-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.upgrade-modal-content {
  position: relative;
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 48px 40px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15),
              0 0 100px rgba(0, 0, 0, 0.05);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upgrade-modal.active .upgrade-modal-content {
  transform: scale(1);
}

.upgrade-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  color: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: all 0.2s;
}

.upgrade-modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.2);
  color: #000000;
  transform: rotate(90deg);
}

.upgrade-modal-header {
  text-align: center;
  margin-bottom: 48px;
  position: relative;
}

.upgrade-modal-header::before {
  content: '';
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
}

.upgrade-modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
  color: #ffffff;
  animation: iconGlow 3s ease-in-out infinite;
}

@keyframes iconGlow {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
  }
  50% {
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
  }
}

.upgrade-modal-title {
  font-size: 28px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #1a1a1a;
  margin: 0 0 12px 0;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.upgrade-modal-subtitle {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.6);
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
}

.upgrade-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.upgrade-pricing-card {
  position: relative;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 32px 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.upgrade-pricing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: 12px 12px 0 0;
}

.upgrade-pricing-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 32px rgba(255, 255, 255, 0.08),
              inset 0 0 40px rgba(255, 255, 255, 0.03);
}

.upgrade-pricing-card:hover::before {
  opacity: 1;
}

.upgrade-pricing-card.popular {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.02);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2),
              0 4px 16px rgba(99, 102, 241, 0.15);
}

.upgrade-pricing-card.popular::before {
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.15), transparent);
}

.upgrade-pricing-card.best-value {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.02);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2),
              0 4px 16px rgba(245, 158, 11, 0.15);
}

.upgrade-pricing-card.best-value::before {
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.15), transparent);
  opacity: 0.5;
}

.upgrade-pricing-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 16px;
  background: #5b6ef6;
  border: none;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.upgrade-pricing-badge.value {
  background: #f59e0b;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
  color: #ffffff;
}

.upgrade-pricing-header {
  margin-bottom: 24px;
}

.upgrade-pricing-header h3 {
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #1a1a1a;
  margin: 0 0 20px 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.9;
}

.upgrade-pricing-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 12px;
}

.upgrade-pricing-currency {
  font-size: 18px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(0, 0, 0, 0.6);
}

.upgrade-pricing-amount {
  font-size: 42px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #1a1a1a;
  line-height: 1;
  letter-spacing: -1px;
}

.upgrade-pricing-period {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.5);
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
}

.upgrade-pricing-save {
  font-size: 12px;
  color: #10b981;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.upgrade-pricing-features {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upgrade-pricing-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.7);
  font-family: 'JetBrains Mono', monospace;
}

.upgrade-pricing-feature svg {
  flex-shrink: 0;
  color: #10b981;
  filter: none;
}

.upgrade-pricing-cta {
  width: 100%;
  padding: 14px 24px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.upgrade-pricing-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.03);
  transition: left 0.4s;
}

.upgrade-pricing-cta:hover::before {
  left: 100%;
}

.upgrade-pricing-cta:hover {
  background: rgba(0, 0, 0, 0.03);
  transform: translateY(-2px);
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.upgrade-pricing-cta.primary {
  background: linear-gradient(135deg, #6366f1 0%, #5b5ff8 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.upgrade-pricing-cta.primary::before {
  background: rgba(255, 255, 255, 0.1);
}

.upgrade-pricing-cta.primary:hover {
  background: linear-gradient(135deg, #5558e8 0%, #4a4ee8 100%);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

/* Gojek-inspired Button Styles */
.upgrade-pricing-cta.gojek-style {
  border-radius: 12px;
  font-weight: 800;
  font-size: 13px;
  padding: 16px 24px;
  text-transform: none;
  letter-spacing: 0.3px;
}

.upgrade-pricing-cta.gojek-style:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.upgrade-pricing-cta.primary.gojek-style {
  background: linear-gradient(135deg, #00AA13 0%, #00C853 100%);
  border: none;
  color: white;
  box-shadow: 0 4px 16px rgba(0, 170, 19, 0.3);
}

.upgrade-pricing-cta.primary.gojek-style:hover {
  background: linear-gradient(135deg, #00C853 0%, #00E676 100%);
  box-shadow: 0 8px 24px rgba(0, 170, 19, 0.4);
  transform: translateY(-3px) scale(1.02);
}

.upgrade-pricing-cta.gojek-style .btn-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.upgrade-modal-footer {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  position: relative;
}

.upgrade-modal-footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
}

.upgrade-modal-footer p {
  font-size: 11px;
  color: rgba(0, 0, 0, 0.5);
  margin: 0;
  line-height: 1.6;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.3px;
}

/* Payment Method Badges */
.payment-method-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.8);
  transition: all 0.2s;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.payment-method-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
}

.payment-method-badge img {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Payment Processing State */
.upgrade-pricing-cta:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 0.5;
  }
}

.btn-loading {
  animation: loadingSpin 1s ease-in-out infinite;
}

@keyframes loadingSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Payment Status Modal Enhancements */
.payment-status-overlay {
  animation: fadeInOverlay 0.3s ease;
}

@keyframes fadeInOverlay {
  from {
    opacity: 0;
    backdrop-filter: blur(0);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(8px);
  }
}

.payment-status-card {
  animation: slideUpFade 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.payment-status-icon {
  animation: iconPop 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

@keyframes iconPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .upgrade-modal-content {
    padding: 32px 24px;
  }

  .upgrade-modal-title {
    font-size: 24px;
  }

  .upgrade-pricing-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .upgrade-pricing-amount {
    font-size: 32px;
  }
}

/* Legacy bot styles removed */
/* Top bar button styling */
.top-bar-btn {
  position: relative;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
}

.top-bar-btn:hover {
  background: var(--hover);
  color: var(--text);
  border-color: var(--border);
}

/* ===== MARKET UPDATES - FULL SCREEN OVERLAY ===== */
/* ═══════════════════════════════════════════════════════════════
   MARKET UPDATES — Premium Research Portal
   Bank-grade research briefing interface
   ═══════════════════════════════════════════════════════════════ */

.mu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: mu-fadeIn 0.3s ease;
}

.mu-container {
  width: 100%;
  height: 100%;
  max-width: 1120px;
  max-height: 96vh;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 25px 80px rgba(0, 0, 0, 0.55),
    0 0 120px rgba(78,124,255,0.04);
  animation: mu-scaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Header ─── */
.mu-header {
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(78,124,255,0.03) 0%, transparent 100%);
}

.mu-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mu-header-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(78,124,255,0.12), rgba(139,92,246,0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--notion-blue);
  flex-shrink: 0;
}

.mu-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: -0.025em;
}

.mu-subtitle {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 2px 0 0 0;
  letter-spacing: 0.01em;
}

.mu-header-actions {
  display: flex;
  gap: 8px;
}

.mu-refresh-btn,
.mu-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--block);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.mu-refresh-btn:hover {
  background: rgba(78,124,255,0.1);
  border-color: rgba(78,124,255,0.3);
  color: var(--notion-blue);
}

.mu-close-btn:hover {
  background: rgba(255,92,92,0.1);
  border-color: rgba(255,92,92,0.3);
  color: var(--notion-red);
}

/* ─── Content Scroll Area ─── */
.mu-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
}

/* ─── Loading / Error / Empty States ─── */
.mu-loading,
.mu-error,
.mu-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: var(--muted);
  text-align: center;
  gap: 16px;
}

.mu-spinner {
  width: 36px;
  height: 36px;
  border: 2.5px solid var(--border);
  border-top-color: var(--notion-blue);
  border-radius: 50%;
  animation: mu-spin 0.8s linear infinite;
}

.mu-retry-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--notion-blue), var(--notion-purple));
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.mu-retry-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(78,124,255,0.3);
}

.mu-empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(78,124,255,0.07), rgba(139,92,246,0.07));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.mu-empty h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.mu-empty p {
  font-size: 0.88rem;
  margin: 0;
}

/* ─── Research Feed Container ─── */
.mu-research-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ─── Badges ─── */
.mu-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-radius: 6px;
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
}

.mu-badge-latest {
  background: rgba(78,124,255,0.15);
  color: var(--notion-blue);
  border: 1px solid rgba(78,124,255,0.2);
  backdrop-filter: blur(8px);
}

.mu-badge-pinned {
  background: rgba(217, 179, 16, 0.12);
  color: var(--notion-yellow);
  border: 1px solid rgba(217, 179, 16, 0.2);
  backdrop-filter: blur(8px);
}

.mu-badge-sm {
  position: static;
  padding: 3px 8px;
  font-size: 0.6rem;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   FEATURED REPORT — Hero Card
   ═══════════════════════════════════════════ */
.mu-featured {
  position: relative;
  background: var(--block);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  animation: mu-cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.mu-featured:hover {
  border-color: rgba(78,124,255,0.35);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(78,124,255,0.08);
  transform: translateY(-2px);
}

/* Featured image — FULL display, no cropping */
.mu-featured-image {
  width: 100%;
  position: relative;
  background: rgba(0,0,0,0.3);
  overflow: hidden;
}

.mu-featured-image img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 420px;
  object-fit: contain;
  background: linear-gradient(135deg, rgba(15,18,25,0.95), rgba(20,24,35,0.95));
}

/* Featured Content */
.mu-featured-content {
  padding: 24px 28px 22px;
}

.mu-featured-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px 0;
  line-height: 1.35;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: -0.02em;
}

.mu-featured-summary {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 18px 0;
  line-height: 1.7;
  max-width: 640px;
}

.mu-featured-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.mu-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.mu-featured-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--notion-blue);
  padding: 10px 20px;
  border-radius: 10px;
  background: rgba(78,124,255,0.08);
  border: 1px solid rgba(78,124,255,0.15);
  transition: all 0.25s;
}

.mu-featured:hover .mu-featured-cta {
  background: rgba(78,124,255,0.14);
  border-color: rgba(78,124,255,0.3);
  gap: 12px;
}

/* ─── Section Divider ─── */
.mu-section-divider {
  display: flex;
  align-items: center;
  margin: 28px 0 20px;
  gap: 14px;
}

.mu-section-divider::before,
.mu-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.mu-section-divider span {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════
   REPORT LIST — Previous Reports
   ═══════════════════════════════════════════ */
.mu-report-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mu-report-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  animation: mu-cardIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  position: relative;
}

.mu-report-item:hover {
  background: var(--block);
  box-shadow: 0 2px 16px rgba(0,0,0,0.1);
}

.mu-report-pinned {
  background: rgba(217, 179, 16, 0.02);
}

.mu-report-pinned:hover {
  background: rgba(217, 179, 16, 0.04);
}

/* Thumbnail — preserve aspect ratio */
.mu-report-thumb {
  width: 110px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
}

.mu-report-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.mu-report-item:hover .mu-report-thumb img {
  transform: scale(1.05);
}

/* Report Info */
.mu-report-info {
  flex: 1;
  min-width: 0;
}

.mu-report-info-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.mu-report-title {
  font-size: 0.95rem;
  font-weight: 640;
  color: var(--text);
  margin: 0;
  line-height: 1.35;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mu-report-summary {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 6px 0;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mu-report-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.75;
}

.mu-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.5;
  flex-shrink: 0;
}

/* Arrow indicator */
.mu-report-arrow {
  flex-shrink: 0;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.25s;
}

.mu-report-item:hover .mu-report-arrow {
  opacity: 0.6;
  transform: translateX(0);
}

/* ═══════════════════════════════════════════
   DETAIL MODAL — Full Research Reading View
   ═══════════════════════════════════════════ */
.mu-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  animation: mu-fadeIn 0.2s ease;
}

.mu-modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 780px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  animation: mu-scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 30px 90px rgba(0, 0, 0, 0.5);
}

.mu-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 0;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  border-radius: 12px;
  z-index: 10;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mu-modal-close:hover {
  background: rgba(255,92,92,0.5);
  border-color: rgba(255,92,92,0.4);
  color: white;
}

/* Scrollable inner area */
.mu-modal-scroll {
  flex: 1;
  overflow-y: auto;
}

/* Modal Header */
.mu-modal-header {
  padding: 32px 36px 24px;
}

.mu-modal-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--notion-blue);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mu-modal-label::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--notion-blue);
  border-radius: 1px;
}

.mu-modal-title {
  font-size: 1.65rem;
  font-weight: 720;
  color: var(--text);
  margin: 0 0 18px 0;
  line-height: 1.3;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: -0.025em;
}

.mu-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding-bottom: 0;
}

.mu-modal-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--muted);
}

.mu-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.mu-translate-btn,
.mu-translate-toggle-btn {
  border-radius: 10px;
  border: 1px solid rgba(78, 124, 255, 0.28);
  background: rgba(78, 124, 255, 0.1);
  color: var(--notion-blue);
  height: 36px;
  padding: 0 14px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.mu-translate-toggle-btn {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border);
  color: var(--text);
}

.mu-translate-btn:hover,
.mu-translate-toggle-btn:hover {
  background: rgba(78, 124, 255, 0.18);
  border-color: rgba(78, 124, 255, 0.4);
}

.mu-translate-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}

.mu-translate-btn:disabled,
.mu-translate-toggle-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.mu-translate-error {
  margin: 10px 0 0 0;
  font-size: 0.78rem;
  color: #f87171;
}

/* Full Figure — NO CROPPING, show entire chart/image */
.mu-modal-figure {
  margin: 0 36px 8px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(10,12,18,0.95), rgba(18,22,32,0.95));
  border: 1px solid var(--border);
}

.mu-modal-figure img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Modal Body / Content */
.mu-modal-body {
  padding: 24px 36px 36px;
}

.mu-modal-content {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text);
}

.mu-modal-content p {
  margin: 0 0 1.1em 0;
}

/* ─── Animations ─── */
@keyframes mu-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes mu-scaleIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes mu-cardIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .mu-overlay {
    padding: 0;
  }

  .mu-container {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .mu-content {
    padding: 20px;
  }

  .mu-header {
    padding: 14px 20px;
  }

  .mu-featured-content {
    padding: 18px 20px 16px;
  }

  .mu-featured-title {
    font-size: 1.1rem;
  }

  .mu-featured-image img {
    max-height: 300px;
  }

  .mu-report-thumb {
    width: 80px;
    height: 54px;
  }

  .mu-report-item {
    padding: 12px 14px;
    gap: 14px;
  }

  .mu-modal-backdrop {
    padding: 0;
  }

  .mu-modal {
    max-height: 100vh;
    max-width: 100%;
    border-radius: 0;
  }

  .mu-modal-header {
    padding: 24px 20px 18px;
  }

  .mu-modal-figure {
    margin: 0 20px 8px;
  }

  .mu-modal-body {
    padding: 18px 20px 28px;
  }

  .mu-modal-title {
    font-size: 1.3rem;
  }

  .mu-modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .mu-translate-btn,
  .mu-translate-toggle-btn {
    width: 100%;
  }
}
/* Market Updates filters + badge overlap fix */
.mu-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.mu-search-wrap {
  flex: 1;
  min-width: 240px;
  position: relative;
}

.mu-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  opacity: 0.8;
}

.mu-search-input {
  width: 100%;
  height: 42px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--block);
  color: var(--text);
  padding: 0 12px 0 38px;
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mu-search-input:focus {
  border-color: rgba(78,124,255,0.45);
  box-shadow: 0 0 0 3px rgba(78,124,255,0.12);
}

.mu-date-filters {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.mu-date-filter {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--muted);
  text-transform: uppercase;
}

.mu-date-filter input {
  height: 42px;
  min-width: 135px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--block);
  color: var(--text);
  padding: 0 10px;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mu-date-filter input:focus {
  border-color: rgba(78,124,255,0.45);
  box-shadow: 0 0 0 3px rgba(78,124,255,0.12);
}

.mu-clear-filters {
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(78,124,255,0.26);
  background: rgba(78,124,255,0.08);
  color: var(--notion-blue);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.mu-clear-filters:hover {
  background: rgba(78,124,255,0.14);
  border-color: rgba(78,124,255,0.4);
}

.mu-badge-inline {
  position: static;
  margin-bottom: 12px;
}

.mu-no-results {
  margin-top: 12px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,0.01);
}

.mu-no-results h3 {
  margin: 0 0 6px 0;
  font-size: 0.98rem;
  color: var(--text);
}

.mu-no-results p {
  margin: 0;
  font-size: 0.84rem;
}

.mu-live-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1205;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.mu-live-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mu-live-toast-content {
  min-width: 260px;
  max-width: 380px;
  border-radius: 12px;
  border: 1px solid rgba(78, 124, 255, 0.28);
  background: rgba(15, 20, 30, 0.96);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.03);
}

.mu-live-toast-content svg {
  color: var(--notion-blue);
  flex-shrink: 0;
}

.mu-live-toast-content span {
  font-size: 0.8rem;
  line-height: 1.35;
  flex: 1;
}

.mu-live-toast-open {
  border: 1px solid rgba(78, 124, 255, 0.35);
  background: rgba(78, 124, 255, 0.14);
  color: var(--notion-blue);
  height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.mu-live-toast-open:hover {
  background: rgba(78, 124, 255, 0.24);
  border-color: rgba(78, 124, 255, 0.45);
}

.mu-live-toast-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.mu-live-toast-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 768px) {
  .mu-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .mu-search-wrap {
    min-width: 0;
  }

  .mu-date-filters {
    width: 100%;
  }

  .mu-date-filter {
    flex: 1;
    min-width: 120px;
  }

  .mu-date-filter input {
    min-width: 0;
    width: 100%;
  }

  .mu-clear-filters {
    width: 100%;
  }

  .mu-live-toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .mu-live-toast-content {
    max-width: none;
    width: 100%;
  }
}

/* ===== LIGHT MODE BUGFIX PATCH ===== */
html:not(.dark) {
  --bg: #f6f8fc;
  --sidebar: #f3f6fb;
  --hover: #e8eef8;
  --border: #d6dfec;
  --text: #0f172a;
  --muted: #475569;
  --block: #ffffff;
  --overlay: rgba(255, 255, 255, 0.92);
}

html:not(.dark) body {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(59, 130, 246, 0.06) 0%, transparent 55%),
    radial-gradient(120% 140% at 100% 0%, rgba(14, 165, 233, 0.05) 0%, transparent 50%),
    var(--bg);
}

html:not(.dark) .sidebar {
  background: linear-gradient(180deg, #f7f9fd 0%, #eef3fa 100%);
  border-right-color: #d2dbea;
}

html:not(.dark) .sidebar-nav-label {
  color: #64748b;
  opacity: 1;
}

html:not(.dark) .sidebar-nav-item {
  color: #475569;
}

html:not(.dark) .sidebar-nav-item:hover {
  background-color: #e8eff9;
  color: #0f172a;
}

html:not(.dark) .sidebar-nav-item.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.3);
  color: #1d4ed8;
}

html:not(.dark) .sidebar-footer {
  background-color: #f7f9fd;
  border-top-color: #d6dfec;
}

html:not(.dark) .top-bar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.82) 100%);
  border-bottom: 1px solid #dce5f1;
  backdrop-filter: blur(10px);
}

html:not(.dark) .top-bar-btn {
  color: #475569;
}

html:not(.dark) .top-bar-btn:hover {
  background-color: #e9effa;
  color: #1f2937;
}

html:not(.dark) .status-badge {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.26);
  color: #065f46;
}

html:not(.dark) .version-badge {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: none;
}

html:not(.dark) .dashboard-panel,
html:not(.dark) .next-event-strip,
html:not(.dark) .block {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-color: #d6dfec;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

html:not(.dark) .block-header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: #dce5f1;
}

html:not(.dark) .profile-dropdown {
  background: #ffffff;
  border-color: #d6dfec;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
}

html:not(.dark) .app-fixed-footer {
  background: rgba(255, 255, 255, 0.9);
  border-top-color: #dce5f1;
  color: #64748b;
}

html:not(.dark) .mobile-backdrop {
  background-color: rgba(15, 23, 42, 0.38);
}

html:not(.dark) .mu-overlay {
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

html:not(.dark) .mu-container {
  box-shadow:
    0 0 0 1px rgba(148, 163, 184, 0.14),
    0 24px 52px rgba(15, 23, 42, 0.18);
}

html:not(.dark) .mu-featured-image,
html:not(.dark) .mu-report-thumb {
  background: #f1f5f9;
}

html:not(.dark) .mu-featured-image img,
html:not(.dark) .mu-report-thumb img {
  background: #f8fafc;
}

html:not(.dark) .mu-search-input,
html:not(.dark) .mu-date-filter input {
  background: #ffffff;
  border-color: #d2dbea;
  color: #0f172a;
}

html:not(.dark) .mu-search-input:focus,
html:not(.dark) .mu-date-filter input:focus {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

html:not(.dark) .mu-live-toast-content {
  background: #ffffff;
  color: #0f172a;
  border-color: #cad6e8;
  box-shadow:
    0 10px 30px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(148, 163, 184, 0.1);
}
