/* Slide-up Sheets - Matching iOS presentationDetents */

.slide-up-sheet {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-sheet-content);
  /* Use visibility and opacity instead of display: none for buttery smooth performance */
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.4s, opacity 0.4s linear;
}

.slide-up-sheet.active {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
  transition: visibility 0s, opacity 0s;
  /* Instant opacity reveal, children handle animation */
}

.sheet-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-sheet-backdrop);
  cursor: pointer;
  /* Indicate it's clickable */
}

.slide-up-sheet.active .sheet-backdrop {
  opacity: 1;
}

.sheet-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: calc(90vh - env(safe-area-inset-bottom, 0px));
  /* Account for iOS safe areas */
  background: var(--brokerly-secondary-background);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sheet-content);
  /* Above backdrop and navigation */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  /* iOS bottom safe area */
  pointer-events: none;
  /* Default to none, enable when active */
  touch-action: auto;
  /* Allow normal touch interactions within sheet */
  will-change: transform;
}

.slide-up-sheet.active .sheet-content {
  pointer-events: auto;
}

/* Specific height for action card drawer to fit the card */
.action-card-drawer .sheet-content {
  max-height: 80vh;
}

/* Host where the focused card sits without resizing */
.action-card-drawer .drawer-card-host {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 20px 16px;
}

/* Ensure unified card design in drawer - no overrides */
.action-card-drawer .action-card {
  /* Force unified card styles from cards-unified.css */
  border: none !important;
  outline: none !important;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
  overflow: hidden !important;
  /* Remove white rim on gradients */
}

/* Remove any frames/borders/overlays on all card elements */
.action-card-drawer .action-card *,
.action-card-drawer .swipeable-card,
.action-card-drawer .card-inner {
  border: none !important;
  outline: none !important;
}

.action-card-drawer .action-card::before,
.action-card-drawer .action-card::after,
.action-card-drawer .swipeable-card::before,
.action-card-drawer .swipeable-card::after,
.action-card-drawer .card-inner::before,
.action-card-drawer .card-inner::after {
  display: none !important;
  content: none !important;
}

/* Ensure card maintains exact unified styling */
.action-card-drawer .action-card {
  container-type: size !important;
  /* Enable cqh units */
}

/* Prevent any drawer-specific style overrides */
.action-card-drawer .drawer-card-host .action-card {
  background: inherit !important;
  /* Use card's own gradient */
  padding: 0 !important;
  /* No padding on outer card */
  margin: 0 auto !important;
  /* Center in drawer */
  /* Make card larger and more prominent in drawer */
  width: min(320px, 90vw) !important;
  height: 456px !important;
  /* Pokémon card ratio: 320w × 456h ≈ 0.70 */
  min-height: 456px !important;
  max-height: 456px !important;
}

@media (max-width: 768px) {
  .action-card-drawer .drawer-card-host .action-card {
    height: 380px !important;
    min-height: 380px !important;
    max-height: 380px !important;
  }
  .action-card-drawer .drawer-card-host .action-card .card-title {
    font-size: 20px !important;
    line-height: 1.2 !important;
    margin-bottom: 8px !important;
  }
  .action-card-drawer .drawer-card-host .action-card .card-description {
    font-size: 13px !important;
    line-height: 1.4 !important;
  }
}

/* Card inner should maintain original padding and alignment */
.action-card-drawer .drawer-card-host .action-card .card-inner {
  padding: 24px !important;
  /* Original padding from unified CSS */
  height: 100%;
}

/* 🖤 Comparison cards must always show dark background in the drawer */
.action-card-drawer .drawer-card-host .action-card.comparison-card {
  background: #0F172A !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: white !important;
}

.action-card-drawer .drawer-card-host .action-card.comparison-card .card-inner {
  background: transparent !important;
  background-image: none !important;
}

.action-card-drawer .drawer-card-host .action-card.comparison-card .card-title,
.action-card-drawer .drawer-card-host .action-card.comparison-card .card-description,
.action-card-drawer .drawer-card-host .action-card.comparison-card .savings-label,
.action-card-drawer .drawer-card-host .action-card.comparison-card .time-label,
.action-card-drawer .drawer-card-host .action-card.comparison-card .time-value {
  color: white !important;
}

.action-card-drawer .drawer-card-host .action-card.comparison-card .savings-amount,
.action-card-drawer .drawer-card-host .action-card.comparison-card .savings-amount * {
  color: #10B981 !important;
  text-shadow: none !important;
}

.action-card-drawer .drawer-card-host .action-card.comparison-card .card-divider {
  background: rgba(255, 255, 255, 0.12) !important;
}

.action-card-drawer .drawer-card-host .action-card.comparison-card .category-badge {
  background: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
}

.action-card-drawer .drawer-card-host .action-card.comparison-card .priority-badge {
  background: rgba(16, 185, 129, 0.2) !important;
}



.action-card-drawer .drawer-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.action-card-drawer .drawer-actions {
  padding: 12px 20px 20px;
  gap: 12px;
  display: grid;
}

/* Dark mode support */
/* Dark mode handled by CSS variables */

.slide-up-sheet.active .sheet-content {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 5px;
  background: var(--brokerly-border);
  border-radius: 3px;
  margin: 12px auto 8px;
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
  /* Enable swipe to dismiss */
  /* Make it more prominent on mobile */
  position: relative;
}

/* Make handle more visible and touch-friendly on mobile */
@media (max-width: 768px) {
  .sheet-handle {
    width: 48px;
    height: 6px;
    background: var(--brokerly-text-quaternary);
    margin: 16px auto 12px;
  }

  /* Add larger touch area */
  .sheet-handle::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -24px;
    right: -24px;
    bottom: -12px;
  }
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--brokerly-border-light);
  flex-shrink: 0;
}

.sheet-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, var(--sheet-title-color-1, #8B5CF6) 0%, var(--sheet-title-color-2, #EC4899) 50%, var(--sheet-title-color-3, #F59E0B) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

/* Premium Header Layout for Right-Side Panels */
.sheet-title-section {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.sheet-title-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sheet-icon-color, var(--brokerly-primary, #34C759)) 0%, rgba(var(--sheet-icon-rgb, 52, 199, 89), 0.75) 100%);
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(var(--sheet-icon-rgb, 52, 199, 89), 0.25);
}

.sheet-title-group {
  display: flex;
  flex-direction: column;
}

.sheet-title-group .sheet-title {
  font-size: 18px;
  line-height: 1.2;
}

.sheet-subtitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
  letter-spacing: 0.02em;
}

.sheet-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-expand-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brokerly-tertiary-background);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brokerly-text-tertiary);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.sheet-expand-btn:hover {
  background: var(--brokerly-border-light);
  color: var(--brokerly-text-primary);
  transform: scale(1.05);
}

.sheet-expand-btn:active {
  transform: scale(0.95);
}

.sheet-expand-btn .expand-btn-label {
  display: none;
  /* Icon only in compact header */
}

.sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brokerly-tertiary-background);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brokerly-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.sheet-close:hover {
  background: var(--brokerly-border-light);
  color: var(--brokerly-text-primary);
  transform: scale(1.05);
}

.sheet-close:active {
  transform: scale(0.95);
}

.sheet-maximize {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brokerly-tertiary-background);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brokerly-text-tertiary);
  /* Changed to tertiary as per instruction */
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  margin-right: 8px;
  /* space before close button */
}

.sheet-maximize:hover {
  background: var(--brokerly-border-light);
  color: var(--brokerly-text-primary);
  transform: scale(1.05);
}

.sheet-maximize:active {
  transform: scale(0.95);
}

/* Ensure close button is always accessible on mobile */
@media (max-width: 768px) {
  .sheet-maximize {
    display: none !important;
  }

  .sheet-close {
    width: 36px;
    height: 36px;
    min-width: 44px;
    min-height: 44px;
  }
}

/* iOS-style text buttons for headers */
.sheet-cancel,
.sheet-save {
  border: none;
  background: transparent;
  color: var(--brokerly-primary);
  font-size: 17px;
  font-weight: 400;
  cursor: pointer;
  padding: 0;
  min-width: 60px;
  transition: opacity 0.2s ease;
}

.sheet-cancel {
  text-align: left;
}

.sheet-save {
  text-align: right;
  font-weight: 600;
}

.sheet-cancel:hover,
.sheet-save:hover {
  opacity: 0.6;
}

.sheet-cancel:active,
.sheet-save:active {
  opacity: 0.3;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Demo Limitation Sheet Specific Styles */

.demo-limitation-icon {
  display: flex;
  justify-content: center;
  padding-top: 20px;
}

.demo-limitation-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.demo-limitation-content h3 {
  font-size: 17px;
  /* iOS headline */
  font-weight: 600;
  /* iOS semibold */
  color: var(--brokerly-text-primary);
  margin: 0;
}

.demo-limitation-content p {
  font-size: 17px;
  /* iOS body */
  font-weight: 400;
  /* iOS regular */
  color: var(--brokerly-text-secondary);
  margin: 0;
  line-height: 1.5;
}

.demo-limitation-instructions {
  padding-top: 8px;
}

.demo-limitation-instructions h4 {
  font-size: 15px;
  /* iOS subheadline */
  font-weight: 600;
  /* iOS semibold */
  color: var(--brokerly-text-primary);
  margin: 0 0 8px 0;
}

.demo-limitation-instructions ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.demo-limitation-instructions li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  /* iOS caption */
  font-weight: 500;
  /* iOS medium */
  color: var(--brokerly-text-secondary);
  line-height: 1.4;
}

.demo-limitation-instructions li::before {
  content: "•";
  flex-shrink: 0;
  margin-top: 2px;
}

.demo-limitation-button {
  width: 100%;
  padding: 16px;
  background: var(--brokerly-primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  /* iOS headline */
  font-weight: 600;
  /* iOS semibold */
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: auto;
}

.demo-limitation-button:hover {
  background: var(--brokerly-primary-dark);
  transform: scale(1.01);
}

.demo-limitation-button:active {
  transform: scale(0.99);
}

/* Responsive adjustments */
@media (min-width: 768px) {
  .sheet-content {
    max-width: 700px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
  }

  .slide-up-sheet.active .sheet-content {
    transform: translateX(-50%) translateY(0);
  }
}

/* ===== PROFILE SHEET ===== */

/* Profile sheet specific overrides */
.profile-sheet {
  max-height: 85vh;
  /* Taller for profile content */
}

.profile-scroll-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 20px 20px;
  -webkit-overflow-scrolling: touch;
}

/* Master-Detail Profile Layout */
.profile-split-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  width: 100%;
  height: calc(100% - 60px); /* Adjust for header */
}

.profile-sidebar {
  width: 100%;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.3s ease;
}

.profile-detail-panel {
  display: none;
  flex: 1;
  background: var(--brokerly-primary-background);
  overflow-y: auto;
  padding: 32px;
  border-left: 1px solid var(--brokerly-border-light);
}

/* Section Header Buttons */
.section-header-button {
  width: calc(100% - 24px) !important;
  margin: 4px 12px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: none;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.section-header-button:hover {
  background: rgba(52, 199, 89, 0.04) !important;
}

.section-header-button.active-sidebar-item {
  background: rgba(52, 199, 89, 0.08) !important;
}

.section-header-button:hover .section-icon-title,
.section-header-button.active-sidebar-item .section-icon-title,
.section-header-button.expanded .section-icon-title {
  color: var(--brokerly-primary, #34C759) !important;
}

.section-header-button:hover .section-icon-title i,
.section-header-button.active-sidebar-item .section-icon-title i,
.section-header-button.expanded .section-icon-title i {
  color: var(--brokerly-primary, #34C759) !important;
}

.section-header-button:hover .chevron-icon,
.section-header-button.active-sidebar-item .chevron-icon,
.section-header-button.expanded .chevron-icon {
  color: var(--brokerly-primary, #34C759) !important;
}

.section-icon-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--brokerly-text-primary);
}

/* Maximized View (Desktop) */
@media screen and (min-width: 769px) {
  /* Ensure the Profile Sheet is wide enough and tall enough for two columns */
  .slide-up-sheet.active.right-side-panel.maximized#profile-sheet-overlay .sheet-content {
    width: 84.5% !important;
    max-width: 84.5vw !important;
    height: calc(95vh / var(--zoom-factor, 0.9)) !important;
    max-height: calc(95vh / var(--zoom-factor, 0.9)) !important;
    border-radius: 24px 0 0 24px !important;
    bottom: 24px !important;
    right: 0 !important;
  }

  .slide-up-sheet.maximized .profile-sidebar {
    width: 320px;
    border-right: 1px solid var(--brokerly-border-light);
  }

  .slide-up-sheet.maximized .profile-detail-panel {
    display: block !important;
    animation: fadeInSlideRight 0.4s ease-out;
    height: 100%;
  }

  /* Hide handle in maximized state */
  .slide-up-sheet.maximized .sheet-handle {
    display: none;
  }

  /* When maximized, internal sidebar sections don't accordion open */
  .slide-up-sheet.maximized .profile-sidebar .section-content {
    display: none !important;
  }

  /* Adjust header button for sidebar look */
  .slide-up-sheet.maximized .profile-sidebar .section-header-button {
    border-bottom: 1px solid var(--brokerly-border-extra-light);
  }
}

/* Detail View Refinement */
.detail-view-container {
  max-width: 700px;
  margin: 0 auto;
}

.detail-view-header {
  margin-bottom: 32px;
}

.detail-view-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
  margin-bottom: 8px;
}

.detail-view-subtitle {
  font-size: 16px;
  color: var(--brokerly-text-secondary);
}

.detail-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0.6;
}

.placeholder-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

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

.profile-header {
  text-align: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--brokerly-border-light);
  margin-bottom: 24px;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(0, 122, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.profile-initial-large {
  font-size: 32px;
  font-weight: 600;
  color: var(--brokerly-primary);
}

.profile-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
  margin: 0 0 4px 0;
}

.profile-email {
  font-size: 15px;
  font-weight: 400;
  color: var(--brokerly-text-secondary);
  margin: 0;
}

.profile-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
  /* No padding or overflow here - handled by parent .profile-scroll-content */
}

.section-header {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--brokerly-text-secondary);
  margin: 0 0 12px 0;
}

.bank-list,
.goals-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bank-item,
.goal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--brokerly-secondary-background);
  border-radius: 12px;
}

.bank-icon,
.goal-icon {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  flex-shrink: 0;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #ffffff !important;
}

.bank-icon {
  background: linear-gradient(135deg, #007AFF 0%, #0056b3 100%) !important;
  box-shadow: 0 3px 8px rgba(0, 122, 255, 0.25) !important;
}

.goal-icon {
  background: linear-gradient(135deg, #34C759 0%, #28a745 100%) !important;
  box-shadow: 0 3px 8px rgba(52, 199, 89, 0.25) !important;
}

.bank-icon svg,
.goal-icon svg {
  width: 16px !important;
  height: 16px !important;
  stroke-width: 2.2px !important;
  color: #ffffff !important;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}

.bank-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--brokerly-text-primary);
}

.goal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.goal-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

.goal-progress {
  font-size: 13px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--brokerly-secondary-background);
  border-radius: 12px;
  overflow: hidden;
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: none;
  border: none;
  color: var(--brokerly-text-primary);
  cursor: pointer;
  transition: background 0.2s ease;
  width: 100%;
  text-align: left;
}

.setting-item:hover {
  background: var(--brokerly-tertiary-background);
}

.setting-item:not(:last-child) {
  border-bottom: 0.5px solid var(--brokerly-border-light);
}

.setting-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.setting-label {
  flex: 1;
  font-size: 15px;
  font-weight: 400;
}

.setting-chevron {
  font-size: 18px;
  color: var(--brokerly-text-tertiary);
}

.sign-out-button {
  width: 100%;
  padding: 16px;
  background: var(--brokerly-danger);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sign-out-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.sign-out-button:active {
  transform: translateY(0);
}


/* ===== FINANCIAL DRAWER STYLES ===== */

.financial-drawer {
  max-height: 85vh;
}

/* Desktop: Make financial drawer taller (75% of viewport height) */
@media (min-width: 768px) {
  .financial-drawer {
    max-height: 75vh;
  }
}

.sheet-handle {
  width: 36px;
  height: 5px;
  background: var(--brokerly-border);
  border-radius: 3px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

/* Drawer Sections */
.drawer-section {
  padding: 0 0 24px 0;
  border-bottom: 1px solid var(--brokerly-border-light);
  margin-bottom: 24px;
}

.drawer-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--brokerly-text-secondary);
  margin: 0 0 12px 0;
}

/* Metric Hero */
.metric-hero {
  text-align: center;
  padding: 24px 0;
}

.hero-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px;
}

.hero-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
  margin-bottom: 8px;
}

.hero-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
}

/* AI Insight Card */
.ai-insight-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--brokerly-secondary-background);
  border-radius: 12px;
  align-items: flex-start;
}

.ai-insight-card.compact {
  padding: 12px;
}

.ai-avatar-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--clive-gradient);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-avatar-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-insight-text {
  flex: 1;
}

.ai-insight-text p {
  margin: 0 0 8px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--brokerly-text-primary);
}

.ai-insight-text p:last-child {
  margin-bottom: 0;
}

.ai-insight-text strong {
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: var(--brokerly-secondary-background);
  border-radius: 8px;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
}

/* Recommendations */
.recommendation-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recommendation-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--brokerly-secondary-background);
  border-radius: 8px;
}

.rec-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.rec-text {
  flex: 1;
}

.rec-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  margin-bottom: 4px;
}

.rec-text p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--brokerly-text-secondary);
}

/* Category Breakdown */
.category-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.category-bar-container {
  width: 100%;
  height: 8px;
  background: var(--brokerly-border-light);
  border-radius: 4px;
  overflow: hidden;
}

.category-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.category-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--brokerly-text-primary);
}

.category-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

/* Savings Opportunities */
.savings-opportunities {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.opportunity-card {
  padding: 16px;
  background: var(--brokerly-secondary-background);
  border-radius: 12px;
}

.opp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.opp-category {
  font-size: 14px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

.opp-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--brokerly-success);
}

.opp-bar {
  width: 100%;
  height: 6px;
  background: var(--brokerly-border-light);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.opp-progress {
  height: 100%;
  background: var(--brokerly-success);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.opp-tip {
  margin: 0;
  font-size: 12px;
  color: var(--brokerly-text-secondary);
}

/* Account List */
.account-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--brokerly-secondary-background);
  border-radius: 8px;
}

.account-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
}

.account-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

.account-type {
  font-size: 12px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
}

.account-balance {
  font-size: 15px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
}

/* Transaction Detail */
.transaction-detail-header {
  text-align: center;
  padding: 16px 0;
}

.transaction-vendor-large {
  font-size: 22px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
  margin-bottom: 8px;
}

.transaction-amount-large {
  font-size: 32px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
  margin-bottom: 8px;
}

.transaction-date-large {
  font-size: 14px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--brokerly-border-light);
  border-radius: 8px;
  overflow: hidden;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--brokerly-secondary-background);
}

.detail-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
}

.detail-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

/* Action Buttons */
.action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-button.primary {
  background: var(--brokerly-primary);
  color: white;
}

.action-button.primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.action-button.primary:active {
  transform: translateY(0);
}

.action-button.secondary {
  background: var(--brokerly-secondary-background);
  color: var(--brokerly-primary);
}

.action-button.secondary:hover {
  background: var(--brokerly-tertiary-background);
}

.action-button.success {
  background: #50C878;
  color: white;
}

.action-button.success:hover {
  opacity: 0.9;
}

.action-button.danger-outline {
  background: transparent;
  border: 1.5px solid #FF6F61;
  color: #FF6F61;
}

.action-button.danger-outline:hover {
  background: #FF6F6110;
}

/* ============================================
   TRANSACTION DETAIL SHEET
   ============================================ */

.transaction-detail-sheet .sheet-content {
  max-height: 80vh;
}

.transaction-header {
  text-align: center;
  padding: 24px 20px;
  background: var(--brokerly-secondary-background);
  border-radius: 12px;
}

.transaction-amount {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}

.transaction-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
}

.transaction-type-badge.income {
  background: #50C87820;
  color: #50C878;
}

.transaction-type-badge.expense {
  background: #FF6F6120;
  color: #FF6F61;
}

.transaction-details-card {
  background: var(--brokerly-secondary-background);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
}

.detail-rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-row {
  display: grid;
  grid-template-columns: 24px 100px 1fr;
  gap: 12px;
  align-items: start;
  padding: 0;
  background: transparent;
}

.detail-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brokerly-text-secondary);
}

.ai-analysis-card {
  background: var(--brokerly-secondary-background);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
}

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

.ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background: var(--brokerly-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-info {
  flex: 1;
}

.ai-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

.ai-subtitle {
  font-size: 13px;
  color: var(--brokerly-text-secondary);
}

.ai-insights {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.insight-section {
  background: var(--brokerly-background);
  padding: 12px;
  border-radius: 8px;
}

.insight-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--brokerly-text-secondary);
  margin-bottom: 8px;
  display: block;
}

.insight-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--brokerly-text-primary);
}

.transaction-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

/* ============================================
   CATEGORY BUDGET SHEET
   ============================================ */

.budget-sheet .sheet-content {
  max-height: 70vh;
}

.budget-category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--brokerly-secondary-background);
  border-radius: 12px;
  margin-bottom: 20px;
}

.category-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border-radius: 12px;
}

.category-info {
  flex: 1;
}

.category-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  margin-bottom: 2px;
}

.category-subtitle {
  font-size: 13px;
  color: var(--brokerly-text-secondary);
}

.budget-input-section {
  margin: 24px 0;
}

.budget-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  display: block;
  margin-bottom: 12px;
}

.budget-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--brokerly-secondary-background);
  padding: 16px;
  border-radius: 12px;
}

.currency-symbol {
  font-size: 24px;
  font-weight: 700;
  color: var(--brokerly-text-secondary);
}

.budget-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 32px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
  outline: none;
}

.budget-input::placeholder {
  color: var(--brokerly-text-tertiary);
}

.current-spending-card {
  background: var(--brokerly-secondary-background);
  padding: 16px;
  border-radius: 12px;
  margin: 16px 0;
}

.spending-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.spending-label {
  font-size: 13px;
  color: var(--brokerly-text-secondary);
}

.spending-amount {
  font-size: 15px;
  font-weight: 600;
}

.spending-progress {
  margin-top: 12px;
}

.progress-bar {
  height: 8px;
  background: var(--brokerly-background);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.progress-percentage {
  color: var(--brokerly-text-secondary);
}

.progress-remaining {
  font-weight: 600;
}

.budget-suggestions {
  background: #007AFF10;
  padding: 12px;
  border-radius: 8px;
  margin: 16px 0;
}

.suggestion-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #007AFF;
  margin-bottom: 8px;
}

.suggestion-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--brokerly-text-primary);
}

.budget-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

/* ============================================
   ACTION DETAIL SHEET
   ============================================ */

.action-detail-sheet .sheet-content {
  max-height: 85vh;
}

.action-card-preview {
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.action-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.action-priority {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
}

.action-savings {
  font-size: 17px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
}

.action-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  margin: 0 0 8px 0;
}

.action-description {
  font-size: 15px;
  line-height: 1.5;
  color: var(--brokerly-text-secondary);
  margin: 0 0 12px 0;
}

.action-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--brokerly-text-secondary);
}

.action-timeframe,
.action-category {
  display: flex;
  align-items: center;
  gap: 4px;
}

.next-steps-section {
  background: var(--brokerly-secondary-background);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  margin-bottom: 16px;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.step-number {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brokerly-primary);
  color: white;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  margin-bottom: 4px;
}

.step-description {
  font-size: 13px;
  color: var(--brokerly-text-secondary);
  line-height: 1.4;
}

.impact-analysis {
  background: var(--brokerly-secondary-background);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.impact-metrics {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.impact-metric {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--brokerly-background);
  border-radius: 8px;
}

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

.metric-info {
  flex: 1;
}

.metric-label {
  font-size: 13px;
  color: var(--brokerly-text-secondary);
  margin-bottom: 2px;
}

.metric-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

.ai-insights-section {
  background: var(--brokerly-secondary-background);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.ai-insight-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--brokerly-text-primary);
}

.action-detail-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  margin: 0 0 8px 0;
}

.empty-state-subtitle {
  font-size: 15px;
  color: var(--brokerly-text-secondary);
  line-height: 1.5;
  margin: 0 0 20px 0;
  max-width: 320px;
}

.empty-state-action {
  padding: 12px 24px;
  background: var(--brokerly-primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.empty-state-action:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ============================================
   DRAWER FILTER
   ============================================ */

.drawer-filter {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  overflow-x: auto;
  border-bottom: 1px solid var(--brokerly-border-light);
  flex-shrink: 0;
}

.filter-pill {
  padding: 6px 16px;
  border: 1.5px solid var(--brokerly-border);
  background: transparent;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-pill:hover {
  border-color: var(--brokerly-primary);
  color: var(--brokerly-primary);
}

.filter-pill.active {
  background: var(--brokerly-primary);
  border-color: var(--brokerly-primary);
  color: white;
}

/* ============================================
   TREND CHARTS & VISUALIZATIONS
   ============================================ */

.hero-trend {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.hero-trend.up {
  color: #FF6F61;
}

.hero-trend.down {
  color: #50C878;
}

.trend-arrow {
  font-size: 14px;
  font-weight: 700;
}

.trend-value {
  font-weight: 600;
}

.trend-label {
  opacity: 0.7;
}

.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 120px;
  padding: 16px;
  background: var(--brokerly-secondary-background);
  border-radius: 8px;
}

.chart-bar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
  min-height: 4px;
}

.chart-label {
  font-size: 11px;
  color: var(--brokerly-text-secondary);
  text-align: center;
}

.transaction-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.transaction-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--brokerly-background);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.transaction-row:hover {
  background: var(--brokerly-secondary-background);
}

.transaction-info {
  flex: 1;
}

.transaction-vendor {
  font-size: 14px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  margin-bottom: 2px;
}

.transaction-date {
  font-size: 12px;
  color: var(--brokerly-text-secondary);
}

.transaction-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

/* ============================================
   OVERVIEW ENHANCEMENTS
   ============================================ */

.priority-action-card {
  width: 100%;
  padding: 16px;
  background: var(--brokerly-secondary-background);
  border: none;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.empty-priority-action {
  text-align: center;
  padding: 32px 20px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  margin-bottom: 4px;
}

.empty-subtitle {
  font-size: 13px;
  color: var(--brokerly-text-secondary);
}

.drill-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.quick-stat-card:hover .drill-indicator,
.priority-action-card:hover .drill-indicator {
  opacity: 1;
}

/* ============================================
   PROFILE SHEET ENHANCEMENTS
   ============================================ */

.bank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--brokerly-secondary-background);
  border-radius: 8px;
  margin-bottom: 8px;
}

.bank-icon {
  font-size: 24px;
}

.bank-name {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--brokerly-text-primary);
}

.bank-status {
  color: var(--brokerly-success);
  font-size: 18px;
}

.goal-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--brokerly-secondary-background);
  border-radius: 8px;
  margin-bottom: 12px;
}

.goal-icon {
  font-size: 28px;
  line-height: 1;
}

.goal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goal-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

.goal-progress-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.goal-progress-bar {
  height: 8px;
  background: var(--brokerly-border);
  border-radius: 4px;
  overflow: hidden;
}

.goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brokerly-primary), var(--brokerly-accent));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.goal-progress-text {
  font-size: 13px;
  color: var(--brokerly-text-secondary);
}

.budget-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--brokerly-secondary-background);
  border-radius: 8px;
  margin-bottom: 8px;
}

.budget-category {
  display: flex;
  align-items: center;
  gap: 10px;
}

.budget-icon {
  font-size: 20px;
}

.budget-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--brokerly-text-primary);
}

.budget-amount {
  font-size: 15px;
  font-weight: 600;
  color: var(--brokerly-primary);
}

.manage-budgets-button,
.connect-bank-button,
.add-goal-button {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  background: var(--brokerly-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.manage-budgets-button:hover,
.connect-bank-button:hover,
.add-goal-button:hover {
  background: var(--brokerly-primary-dark);
  transform: translateY(-1px);
}

.budget-empty-state {
  text-align: center;
  padding: 24px 16px;
  color: var(--brokerly-text-secondary);
}

.budget-empty-state p {
  margin: 0;
  font-size: 15px;
}

.budget-empty-state .budget-empty-hint {
  font-size: 13px;
  margin-top: 4px;
  opacity: 0.7;
}

.empty-list {
  text-align: center;
  padding: 24px;
}

.empty-list p {
  color: var(--brokerly-text-secondary);
  margin-bottom: 16px;
}

/* ============================================
   AI THINKING STEPS
   ============================================ */

.ai-thinking-steps {
  margin: 16px 0;
}

.thinking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.thinking-header:hover {
  background: rgba(255, 255, 255, 0.08);
}

.thinking-header-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.thinking-icon-complete {
  width: 14px;
  height: 14px;
}

.thinking-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

.thinking-chevron {
  width: 10px;
  height: 10px;
  color: var(--brokerly-text-secondary);
  transition: transform 0.3s ease;
}

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

.thinking-progress {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.thinking-progress-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
  padding: 2px 6px;
  background: var(--brokerly-secondary-background);
  border-radius: 4px;
}

.thinking-steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thinking-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: transparent;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.thinking-step.active {
  background: rgba(255, 255, 255, 0.05);
}

.step-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.step-icon {
  font-size: 12px;
  transition: all 0.3s ease;
}

.step-icon.rotating {
  animation: rotate 2s linear infinite;
}

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

  to {
    transform: rotate(360deg);
  }
}

.step-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

.thinking-step:not(.active):not(.past) .step-title {
  color: var(--brokerly-text-secondary);
  opacity: 0.7;
}

.step-description {
  font-size: 11px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
  line-height: 1.4;
}

.thinking-step:not(.active):not(.past) .step-description {
  opacity: 0.5;
}

.step-duration {
  font-size: 10px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
  opacity: 0.8;
}

.thinking-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.thinking-result.success {
  background: rgba(255, 255, 255, 0.15);
}

.thinking-result.error {
  background: rgba(239, 68, 68, 0.1);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.result-icon-error {
  width: 14px;
  height: 14px;
  color: #ef4444;
}

.result-title {
  font-size: 14px;
  font-weight: 600;
  color: #ef4444;
}

.result-message {
  font-size: 12px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
  line-height: 1.5;
}

.result-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--brokerly-text-primary);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (min-width: 768px) {
  .sheet-content {
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
  }

  .slide-up-sheet.active .sheet-content {
    transform: translateX(-50%) translateY(0);
  }

  .transaction-detail-sheet .sheet-content,
  .budget-sheet .sheet-content,
  .action-detail-sheet .sheet-content {
    max-height: 90vh;
  }
}

/* ============================================
   AI AGENT BUTTON
   ============================================ */

.ai-agent-button {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg,
      var(--brokerly-primary) 0%,
      rgba(87, 204, 234, 0.8) 50%,
      rgba(87, 204, 234, 0.9) 100%);
  color: white;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(87, 204, 234, 0.3);
}

.ai-agent-button:hover:not(.loading) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(87, 204, 234, 0.4);
}

.ai-agent-button.pressed {
  transform: scale(0.98) translateY(0);
}

.ai-agent-button.loading {
  cursor: wait;
  opacity: 0.8;
}

.ai-agent-button.complete {
  background: linear-gradient(135deg, #50C878, #45B56A);
}

.agent-btn-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-avatar {
  flex-shrink: 0;
}

.agent-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: white;
}

.agent-text {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  text-align: left;
}

.agent-status {
  flex-shrink: 0;
}

.agent-spinner svg {
  animation: spin 1s linear infinite;
}

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

  to {
    transform: rotate(360deg);
  }
}

/* Flippable Card */
.flippable-card-container {
  perspective: 1000px;
  width: 100%;
}

.flippable-card {
  position: relative;
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
  transform-style: preserve-3d;
}

.flippable-card.flipped {
  transform: rotateY(180deg);
}

.card-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-face-back {
  transform: rotateY(180deg);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

/* ============================================
   PROPOSED ACTIONS DRAWER
   ============================================ */

.proposed-actions-sheet {
  max-height: 90vh;
}

/* Card stacking for proposed actions - Pokémon card aspect ratio with visible stacking */
.proposed-actions-sheet .swipe-cards-container {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 520px;
  /* Taller to accommodate Pokémon card ratio + stacking */
  margin: 20px auto;
  perspective: 1000px;
}

/* Override swipeable-card to use absolute positioning for stacking */
.proposed-actions-sheet .swipeable-card {
  position: absolute !important;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 260px;
  /* Fixed width for Pokémon card */
  height: 370px;
  /* Pokémon card aspect ratio (roughly 2.6:3.7 or 0.7:1) */
  max-width: none;
  aspect-ratio: unset;
  /* Ensure cards are opaque to prevent ghosting */
  background: var(--modern-card-background) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .proposed-actions-sheet .swipeable-card {
  background: #1e293b !important; /* Solid navy for dark mode */
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white !important;
}

[data-theme="dark"] .proposed-actions-sheet .swipeable-card .card-title {
  color: white !important;
}

[data-theme="dark"] .proposed-actions-sheet .swipeable-card .card-description {
  color: rgba(255, 255, 255, 0.8) !important;
}

[data-theme="dark"] .proposed-actions-sheet .swipeable-card .savings-label,
[data-theme="dark"] .proposed-actions-sheet .swipeable-card .time-label,
[data-theme="dark"] .proposed-actions-sheet .swipeable-card .category-badge {
  color: rgba(255, 255, 255, 0.6) !important;
}

[data-theme="dark"] .proposed-actions-sheet .swipeable-card .savings-amount {
  color: #10B981 !important; /* Emerald green for savings value */
}

/* Discover Premium Comparison Card styling */
.proposed-actions-sheet .swipeable-card.discover-premium-card {
  background: var(--comparison-bg) !important;
  background-image: var(--comparison-gradient) !important;
  border: 1px solid var(--comparison-border) !important;
}

.proposed-actions-sheet .swipeable-card.discover-premium-card .card-title,
.proposed-actions-sheet .swipeable-card.discover-premium-card .card-description {
  color: var(--comparison-text-primary) !important;
}

.proposed-actions-sheet .swipeable-card.discover-premium-card .savings-label,
.proposed-actions-sheet .swipeable-card.discover-premium-card .time-label,
.proposed-actions-sheet .swipeable-card.discover-premium-card .category-badge {
  color: var(--comparison-text-secondary) !important;
  opacity: 0.8;
}

.proposed-actions-sheet .swipeable-card.discover-premium-card .savings-amount {
  color: var(--comparison-savings) !important;
}

/* Discover Alert Card styling (Coral) */
.proposed-actions-sheet .swipeable-card.alert-card {
  background: var(--alert-bg) !important;
  background-image: var(--alert-gradient) !important;
  border: 1px solid var(--alert-border) !important;
}

.proposed-actions-sheet .swipeable-card.alert-card .card-title {
  color: var(--alert-text-primary) !important;
}

.proposed-actions-sheet .swipeable-card.alert-card .card-description {
  color: var(--alert-text-secondary) !important;
}

.proposed-actions-sheet .swipeable-card.alert-card .savings-label,
.proposed-actions-sheet .swipeable-card.alert-card .time-label,
.proposed-actions-sheet .swipeable-card.alert-card .category-badge {
  color: var(--alert-text-secondary) !important;
}

.proposed-actions-sheet .swipeable-card.alert-card .priority-badge {
  color: var(--alert-accent) !important;
  background: var(--alert-accent-light) !important;
}

.proposed-actions-sheet .swipeable-card.alert-card .savings-amount {
  color: var(--alert-accent) !important;
}

.proposed-actions-sheet .swipeable-card.alert-card .time-value {
  color: var(--alert-accent) !important;
}

/* Discover Insight Card styling (Mint) */
.proposed-actions-sheet .swipeable-card.insight-card {
  background: var(--insight-bg) !important;
  background-image: var(--insight-gradient) !important;
  border: 1px solid var(--insight-border) !important;
}

.proposed-actions-sheet .swipeable-card.insight-card .card-title {
  color: var(--insight-text-primary) !important;
}

.proposed-actions-sheet .swipeable-card.insight-card .card-description {
  color: var(--insight-text-secondary) !important;
}

.proposed-actions-sheet .swipeable-card.insight-card .savings-label,
.proposed-actions-sheet .swipeable-card.insight-card .time-label,
.proposed-actions-sheet .swipeable-card.insight-card .category-badge {
  color: var(--insight-text-secondary) !important;
}

.proposed-actions-sheet .swipeable-card.insight-card .priority-badge {
  color: var(--insight-accent) !important;
  background: var(--insight-accent-light) !important;
}

.proposed-actions-sheet .swipeable-card.insight-card .savings-amount {
  color: var(--insight-accent) !important;
}

/* Discover Quick Action Card styling (Blue) */
.proposed-actions-sheet .swipeable-card.action-card-quick {
  background: var(--quick-bg) !important;
  background-image: var(--quick-gradient) !important;
  border: 1px solid var(--quick-border) !important;
}

.proposed-actions-sheet .swipeable-card.action-card-quick .card-title {
  color: var(--quick-text-primary) !important;
}

.proposed-actions-sheet .swipeable-card.action-card-quick .card-description {
  color: var(--quick-text-secondary) !important;
}

.proposed-actions-sheet .swipeable-card.action-card-quick .savings-label,
.proposed-actions-sheet .swipeable-card.action-card-quick .time-label,
.proposed-actions-sheet .swipeable-card.action-card-quick .category-badge {
  color: var(--quick-text-secondary) !important;
}

.proposed-actions-sheet .swipeable-card.action-card-quick .priority-badge {
  color: var(--quick-accent) !important;
  background: var(--quick-accent-light) !important;
}

.proposed-actions-sheet .swipeable-card.action-card-quick .savings-amount {
  color: var(--quick-accent) !important;
}

/* Visible stacking - cards offset down and slightly scaled */
.proposed-actions-sheet .swipeable-card.top {
  z-index: 3;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.proposed-actions-sheet .swipeable-card.second {
  z-index: 2;
  transform: scale(0.97) translateY(12px);
  opacity: 0.9;
  filter: brightness(0.95);
  pointer-events: none;
}

.proposed-actions-sheet .swipeable-card.third {
  z-index: 1;
  transform: scale(0.94) translateY(24px);
  opacity: 0.8;
  filter: brightness(0.90);
  pointer-events: none;
}

/* Ensure card inner content fits properly */
.proposed-actions-sheet .card-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  overflow: hidden;
}

/* Text formatting for card content */
.proposed-actions-sheet .card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  margin: 12px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.proposed-actions-sheet .card-description {
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin-bottom: 12px;
}

.proposed-actions-sheet .savings-display {
  margin: 12px 0;
}

.proposed-actions-sheet .savings-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.proposed-actions-sheet .savings-amount {
  font-size: 32px;
  font-weight: 800;
}

.proposed-actions-sheet .time-to-complete {
  margin-top: 8px;
}

.proposed-actions-sheet .time-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.proposed-actions-sheet .time-value {
  font-size: 13px;
  font-weight: 600;
}

/* Hide empty/undefined cards */
.proposed-actions-sheet .swipeable-card:not([data-action-id]) {
  display: none;
}

.proposed-actions-sheet .sheet-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 16px;
}

.header-info {
  flex: 1;
}

.header-counter {
  flex-shrink: 0;
}

.counter-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--brokerly-text-secondary);
  padding: 6px 12px;
  background: var(--brokerly-secondary-background);
  border-radius: 12px;
}

.progress-bar-container {
  padding: 0 20px 16px;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--brokerly-secondary-background);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--brokerly-primary);
  transition: width 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
  border-radius: 2px;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
}

.loading-state .spinner {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(194, 196, 181, 0.2);
  border-top: 3px solid #ff6f61;
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}

.loading-state p {
  font-size: 16px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 20px;
  text-align: center;
}

.empty-icon {
  font-size: 60px;
}

.empty-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
  margin: 0;
}

.empty-subtitle {
  font-size: 16px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
  max-width: 400px;
  line-height: 1.5;
  margin: 0;
}

.action-summary {
  display: flex;
  gap: 20px;
  padding: 16px 24px;
  background: var(--brokerly-secondary-background);
  border-radius: 12px;
}

.summary-item {
  display: flex;
  gap: 8px;
  align-items: center;
}

.summary-label {
  font-size: 14px;
  font-weight: 600;
}

.summary-count {
  font-size: 18px;
  font-weight: 700;
}

.summary-item.rejected .summary-label,
.summary-item.rejected .summary-count {
  color: #FF6F61;
}

.summary-item.accepted .summary-label,
.summary-item.accepted .summary-count {
  color: #50C878;
}

.btn-primary {
  padding: 16px 32px;
  background: var(--brokerly-primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(87, 204, 234, 0.3);
}

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

/* ============================================
   AI ASSISTANT DRAWER
   ============================================ */

.ai-assistant-drawer .sheet-content {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

/* Drag Handle */
.drag-handle {
  width: 36px;
  height: 5px;
  background: var(--brokerly-text-quaternary);
  border-radius: 3px;
  margin: 8px auto 16px;
}

/* Assistant Header */
.assistant-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--brokerly-border-light);
}

.assistant-avatar {
  flex-shrink: 0;
}

.assistant-avatar .avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brokerly-primary), var(--brokerly-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  font-weight: 700;
  position: relative;
}

.assistant-avatar .multicolor-border {
  border: 2px solid transparent;
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-image:
    linear-gradient(white, white),
    var(--gradient-multicolor-8);
}

.assistant-info {
  flex: 1;
}

.assistant-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
  margin: 0 0 4px 0;
}

.assistant-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #50C878;
  box-shadow: 0 0 4px rgba(80, 200, 120, 0.5);
}

.status-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
}

/* Assistant Content */
.assistant-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* AI Response Bubble */
.ai-response-bubble {
  position: relative;
  background: var(--brokerly-primary-light);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 24px;
}

.bubble-pointer {
  position: absolute;
  top: -8px;
  left: 24px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--brokerly-primary-light);
}

.response-message {
  font-size: 16px;
  line-height: 1.6;
  color: var(--brokerly-text-primary);
  margin: 0;
}

/* Action Plan */
.action-plan {
  margin-bottom: 24px;
}

.plan-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
  margin: 0 0 16px 0;
}

.plan-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.plan-step {
  display: flex;
  gap: 12px;
}

.step-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brokerly-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.step-content {
  flex: 1;
}

.step-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  margin: 0 0 4px 0;
}

.step-description {
  font-size: 14px;
  color: var(--brokerly-text-secondary);
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.step-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.step-action-btn {
  padding: 8px 16px;
  background: var(--brokerly-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.step-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(87, 204, 234, 0.3);
}

/* Quick Actions */
.assistant-quick-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--brokerly-border-light);
}

.quick-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--brokerly-secondary-background);
  border: 1px solid var(--brokerly-border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-action-btn:hover {
  background: var(--brokerly-tertiary-background);
  transform: translateY(-1px);
}

.quick-action-btn svg {
  color: var(--brokerly-primary);
}

/* Loading State */
.assistant-content .loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
}

.assistant-content .loading-state .spinner {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(194, 196, 181, 0.2);
  border-top: 3px solid #ff6f61;
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}

.assistant-content .loading-state p {
  font-size: 16px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
  text-align: center;
}

/* ============================================
   PROFILE SHEET - Collapsible Sections
   ============================================ */

.section-header-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.section-header-button:hover {
  opacity: 0.7;
}

.section-icon-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

.section-icon-title svg {
  color: var(--brokerly-primary);
}

.chevron-icon {
  color: var(--brokerly-text-secondary);
  transition: transform 0.3s ease;
}

.section-header-button.expanded .chevron-icon {
  transform: rotate(180deg);
}

.section-content {
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
  padding-top: 8px;
}

/* Bank Toggle Rows */
.bank-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(142, 142, 147, 0.06);
  border-radius: 12px;
  transition: all 0.2s;
}

.bank-toggle-row:hover {
  background: rgba(142, 142, 147, 0.1);
}

.bank-toggle-row .bank-icon {
  font-size: 24px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bank-toggle-row .bank-info {
  flex: 1;
}

.bank-toggle-row .bank-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  margin: 0 0 2px 0;
}

.bank-toggle-row .bank-status {
  font-size: 13px;
  color: var(--brokerly-text-secondary);
  margin: 0;
}

/* Goals Chip Grid */
.goals-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  padding: 8px 0;
}

.goal-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(142, 142, 147, 0.06);
  border: 1.5px solid transparent;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brokerly-text-primary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.goal-chip:hover {
  background: rgba(142, 142, 147, 0.1);
  transform: scale(1.02);
}

.goal-chip.selected {
  background: rgba(52, 199, 89, 0.1);
  border-color: var(--brokerly-primary);
  color: var(--brokerly-primary);
}

.goal-chip.selected svg {
  color: var(--brokerly-primary);
  flex-shrink: 0;
}

.goal-chip span {
  flex: 1;
  line-height: 1.3;
}

@media (max-width: 480px) {
  .goals-chip-grid {
    grid-template-columns: 1fr;
  }
}

/* Removed duplicate - scrolling now handled by .profile-scroll-content */

/* ============================================
   MOBILE-SPECIFIC IMPROVEMENTS
   ============================================ */

@media (max-width: 768px) {

  /* Prevent body scroll when sheet is open */
  body.sheet-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100vh;
    height: -webkit-fill-available;
  }

  /* Full height sheets on mobile with safe area consideration */
  .slide-up-sheet .sheet-content {
    max-height: calc(95vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }

  /* Ensure sheets don't interfere with tab navigation */
  .slide-up-sheet {
    bottom: 0;
  }

  /* Scrollable content areas should respect safe areas */
  .sheet-body,
  .profile-scroll-content {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    max-height: calc(85vh - env(safe-area-inset-top, 20px) - env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Prevent scroll chaining */
  }

  /* Profile sheet specific mobile adjustments */
  .profile-sheet {
    max-height: calc(90vh - env(safe-area-inset-bottom, 0px));
  }

  .profile-sheet .profile-scroll-content {
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
  }

  /* Financial drawer mobile adjustments */
  .financial-drawer {
    max-height: calc(85vh - env(safe-area-inset-bottom, 0px));
  }

  /* Action card drawer mobile adjustments */
  .action-card-drawer .sheet-content {
    max-height: calc(85vh - env(safe-area-inset-bottom, 0px));
  }
}

/* ============================================
   FINANCIAL DRAWER - iOS Matching Styles
   ============================================ */

/* AI Assistant Section */
.ai-assistant-section {
  background: var(--card-background);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
}

.ai-avatar-border {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg,
      #FF6F61,
      #FFD700,
      #50C878,
      #007AA5,
      #007AFF,
      #FF6F61);
  background-size: 200% 200%;
  animation: rotateGradient 3s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-avatar-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.ai-info {
  flex: 1;
}

.ai-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  margin-bottom: 2px;
}

.ai-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: var(--brokerly-text-secondary);
}

.ai-commentary {
  padding: 8px 20px 20px;
  min-height: 120px;
  max-height: 30vh;
  overflow-y: auto;
  position: relative;
  background: var(--brokerly-secondary-background);
}

.commentary-section {
  margin-bottom: 12px;
}

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

.commentary-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--brokerly-text-secondary);
  margin-bottom: 8px;
}

.commentary-text {
  font-size: 16px;
  font-weight: 400;
  color: var(--brokerly-text-primary);
  line-height: 1.5;
}

/* Analysis Section */
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.analysis-card {
  background: var(--brokerly-secondary-background);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.analysis-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.analysis-header svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.analysis-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
}

.analysis-value {
  font-size: 20px;
  font-weight: 700;
  color: #007AFF;
}

/* Chart Section */
.chart-section {
  background: var(--brokerly-secondary-background);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.chart-header {
  margin-bottom: 20px;
}

.chart-subtitle {
  font-size: 14px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
  margin-top: 4px;
}

.chart-container-enhanced {
  height: 260px;
  position: relative;
}

.chart-container-enhanced canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Drawer scrolling behavior */
.financial-drawer .sheet-body {
  overflow-y: auto;
  padding: 20px;
}

/* Desktop: Ensure scrollable area fills the drawer */
@media (min-width: 768px) {
  .financial-drawer .sheet-body {
    /* flex: 1 already handles height distribution */
  }
}

.financial-drawer .sheet-body::-webkit-scrollbar {
  width: 4px;
}

.financial-drawer .sheet-body::-webkit-scrollbar-thumb {
  background: rgba(142, 142, 147, 0.3);
  border-radius: 4px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .chart-section {
    padding: 16px;
  }

  .chart-container-enhanced {
    height: 220px;
  }
}

/* Profile Sheet Collapsible Section Styles */
.profile-section.collapsible {
  border-bottom: none;
}

.section-header-button {
  width: calc(100% - 24px) !important;
  margin: 4px 12px !important;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.section-header-button:hover {
  background-color: rgba(52, 199, 89, 0.04) !important;
}

.section-header-button.expanded {
  background-color: rgba(52, 199, 89, 0.08) !important;
}

.section-icon-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--brokerly-text-primary);
}

.chevron-icon {
  transition: transform 0.3s ease;
}

.section-header-button.expanded .chevron-icon {
  transform: rotate(180deg);
}

/* Info Row Styles */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #f3f4f6;
}

.info-label {
  font-size: 14px;
  color: var(--brokerly-text-secondary);
}

.info-value {
  font-size: 14px;
  color: var(--brokerly-text-primary);
  font-weight: 500;
}

/* Section Action Buttons */
.section-edit-button,
.section-view-button {
  width: calc(100% - 40px);
  margin: 12px 20px;
  padding: 10px;
  background: var(--brokerly-input-background);
  border: 1px solid var(--brokerly-border-light);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--brokerly-text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.section-edit-button:hover,
.section-view-button:hover {
  background: var(--brokerly-secondary-background);
  border-color: var(--brokerly-border-medium);
}

/* Assistant Chips (inline editing) */
.assistant-chips {
  display: flex;
  gap: 8px;
}

.assistant-chip {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--brokerly-border-medium);
  background: var(--modern-card-background);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.assistant-chip.selected {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.assistant-chip:hover:not(.selected) {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* Bank Logo Animations */
.bank-logo-container {
  position: relative;
  width: 60px;
  height: 60px;
}

.bank-logo-background {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: var(--modern-card-background);
  position: relative;
  overflow: hidden;
  border: 3px solid transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.bank-toggle-row.connected .bank-logo-background {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.liquid-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0%;
  transition: height 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
  opacity: 0.15;
}

.bank-toggle-row.connected .liquid-fill {
  height: 100%;
}

.bank-logo {
  position: relative;
  z-index: 2;
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin: 6px;
  transition: transform 0.3s ease;
}

.bank-toggle-row.connected .bank-logo {
  transform: scale(1.1);
}

/* Goal Card Animations */
.goal-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--modern-card-background);
  border-radius: 16px;
  border: 1px solid var(--brokerly-border-medium);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
}

.goal-card.selected {
  border-color: var(--goal-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--goal-color);
  transform: scale(1.02);
}

.goal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--goal-color);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.goal-card.selected::before {
  opacity: 0.03;
}

.goal-icon-container {
  flex-shrink: 0;
}

.goal-icon-background {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--goal-color) 10%, white);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.goal-liquid-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: linear-gradient(180deg,
      color-mix(in srgb, var(--goal-color) 80%, white),
      var(--goal-color));
  transition: height 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.goal-card.selected .goal-liquid-fill {
  height: 100%;
}

.goal-icon {
  position: relative;
  z-index: 2;
  font-size: 24px;
  color: var(--goal-color);
  transition: all 0.3s ease;
}

.goal-card.selected .goal-icon {
  color: white;
  transform: scale(1.1);
}

.goal-content {
  flex: 1;
}

.goal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  margin: 0 0 4px 0;
}

.goal-subtitle {
  font-size: 14px;
  color: var(--brokerly-text-secondary);
  margin: 0;
}

.goal-selector {
  flex-shrink: 0;
}

.goal-selector-ring {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.goal-card.selected .goal-selector-ring {
  background: var(--goal-color);
  border-color: var(--goal-color);
}

.goal-checkmark {
  font-size: 14px;
  color: white;
}

.goal-tap-feedback {
  transform: scale(0.98);
}

/* Budget Inline Editing */
.budget-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 12px;
  margin-bottom: 12px;
}

.budget-icon-container {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.budget-icon {
  font-size: 20px;
  color: var(--brokerly-text-secondary);
}

.budget-info {
  flex: 1;
}

.budget-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--brokerly-text-primary);
  display: block;
  margin-bottom: 4px;
}

.budget-input-inline {
  display: flex;
  align-items: center;
  gap: 4px;
}

.currency {
  font-size: 16px;
  font-weight: 600;
  color: var(--brokerly-text-secondary);
}

.budget-amount-input {
  border: none;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  width: 80px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.budget-amount-input:focus {
  outline: none;
  background: var(--brokerly-input-background);
  box-shadow: 0 0 0 2px var(--brokerly-primary);
}

.budget-amount-input.saved {
  background: #dcfce7;
  color: #166534;
}

.budget-remove-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.budget-remove-btn:hover {
  background: #fef2f2;
}

.budget-add-category-btn {
  width: 100%;
  padding: 16px;
  background: var(--brokerly-input-background);
  border: 2px dashed var(--brokerly-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--brokerly-text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.budget-add-category-btn:hover {
  background: var(--brokerly-secondary-background);
  border-color: var(--brokerly-border-medium);
  color: var(--brokerly-text-primary);
}


/* Goal List Styles */
.goals-list {
  padding: 0;
}

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

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

.goals-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--brokerly-text-secondary);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.goals-list-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goal-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--modern-card-background);
  border: 1px solid var(--brokerly-border-medium);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.goal-list-item:hover {
  border-color: var(--goal-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.goal-list-item.selected {
  border-color: var(--goal-color);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--goal-color);
  background: color-mix(in srgb, var(--goal-color) 2%, white);
}

.goal-list-icon {
  flex-shrink: 0;
}

.goal-list-icon .goal-icon-background {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--goal-color) 8%, white);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.goal-list-icon .goal-liquid-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: linear-gradient(180deg,
      color-mix(in srgb, var(--goal-color) 60%, white),
      var(--goal-color));
  transition: height 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.goal-list-item.selected .goal-list-icon .goal-liquid-fill {
  height: 100%;
}

.goal-list-icon .goal-icon {
  position: relative;
  z-index: 2;
  font-size: 20px;
  color: var(--goal-color);
  transition: all 0.2s ease;
}

.goal-list-item.selected .goal-list-icon .goal-icon {
  color: white;
  transform: scale(1.05);
}

.goal-list-content {
  flex: 1;
  min-width: 0;
}

.goal-list-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.goal-list-subtitle {
  font-size: 13px;
  color: var(--brokerly-text-secondary);
  margin: 0;
  line-height: 1.4;
}

.goal-list-checkbox {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.goal-checkmark {
  font-size: 20px;
  color: var(--goal-color);
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease;
}

.goal-list-item.selected .goal-checkmark {
  opacity: 1;
  transform: scale(1);
}

.goal-checkbox-ring {
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.goal-list-item:hover .goal-checkbox-ring {
  border-color: var(--goal-color);
}

.goal-tap-feedback {
  transform: scale(0.98);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none !important;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal-backdrop);
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-overlay.active {
  display: flex !important;
}

.modal-overlay.closing {
  animation: fadeOut 0.2s ease-out forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.modal-content {
  background: var(--modern-card-background);
  border-radius: 16px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.about-modal {
  text-align: center;
}

.about-modal h2 {
  margin: 0 0 16px 0;
  color: var(--brokerly-text-primary);
}

.about-modal p {
  margin: 8px 0;
  color: var(--brokerly-text-secondary);
}

.modal-close-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 16px;
}

.category-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.category-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--brokerly-input-background);
  border: 1px solid var(--brokerly-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.category-option:hover {
  background: var(--brokerly-secondary-background);
  border-color: var(--brokerly-border-medium);
}

.category-option ion-icon {
  font-size: 24px;
  color: var(--brokerly-text-secondary);
}

.category-option span {
  font-size: 14px;
  font-weight: 500;
  color: var(--brokerly-text-primary);
}

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

.modal-cancel-btn {
  background: var(--brokerly-input-background);
  color: var(--brokerly-text-secondary);
  border: 1px solid var(--brokerly-border);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-cancel-btn:hover {
  background: var(--brokerly-secondary-background);
  border-color: var(--brokerly-border-medium);
}

/* ============================================
   Financial Drawer Enhancements
   ============================================ */

/* AI Insight Speech Bubble - Default to Clive's purple */
.ai-insight-bubble,
.ai-insight-bubble.clive {
  display: flex;
  gap: 12px;
  padding: 16px;
  margin: 16px 0;
  background: var(--clive-light);
  border: 1.5px solid var(--clive-primary);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(var(--clive-primary-rgb), 0.05);
}

/* Clara's dusty sage gradient */
.ai-insight-bubble.clara {
  background: var(--clara-light) !important;
  border: 1.5px solid var(--clara-primary) !important;
  box-shadow: 0 4px 12px rgba(var(--clara-primary-rgb), 0.05) !important;
}

.ai-insight-bubble .ai-avatar {
  flex-shrink: 0;
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  min-height: 56px !important;
  border-radius: 50%;
  overflow: hidden;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ai-insight-bubble.clive .ai-avatar {
  border: 2px solid var(--clive-primary) !important;
}

.ai-insight-bubble.clara .ai-avatar {
  border: 2px solid var(--clara-primary) !important;
}

.ai-insight-bubble .ai-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .ai-insight-bubble .ai-avatar {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
  }
}

.insight-content {
  flex: 1;
  color: var(--brokerly-text-primary);
  font-size: 14px;
  line-height: 1.6;
}

.insight-content p {
  margin: 0;
}

.insight-content strong {
  font-weight: 600;
  display: inline-block;
  margin-bottom: 0px;
  font-size: 14px;
}

.ai-insight-bubble.clive .insight-content strong {
  color: var(--clive-primary);
}

.ai-insight-bubble.clara .insight-content strong {
  color: var(--clara-secondary);
}

[data-theme="dark"] .ai-insight-bubble.clara .insight-content strong,
.dark-mode .ai-insight-bubble.clara .insight-content strong {
  color: var(--clara-primary);
}

.insight-content p {
  margin: 0 0 12px 0;
}

.insight-content p:last-child {
  margin-bottom: 0;
}

.loading-insight {
  opacity: 0.8;
  font-style: italic;
}

/* Metric Summary Card - Harmonized with Dashboard Pills */
.metric-summary-card {
  background: var(--pill-bg, linear-gradient(135deg, #f6f8fb 0%, #ffffff 100%));
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 24px; /* Balanced radius for larger card, matching 16px pill aesthetic */
  padding: 20px 24px;
  margin: 16px auto 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start; /* Left-aligned like the pill */
  gap: 20px;
  width: 95%;
  max-width: 440px;
  min-height: 100px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); /* Softer shadow */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

@media (min-width: 768px) {
  .metric-summary-card {
    padding: 28px 32px;
    gap: 28px;
    max-width: 480px;
    min-height: 120px;
    border-radius: 32px;
  }
}

.metric-label {
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  text-transform: none;
  opacity: 0.8;
  margin-bottom: 0;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .metric-label {
    font-size: 16px;
  }
}

.current-value {
  font-size: clamp(24px, 7vw, 32px);
  font-weight: 700;
  color: #374151;
  margin-bottom: 2px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .current-value {
    font-size: 44px;
  }
}

.trend-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.trend-indicator.up { color: #10b981; }
.trend-indicator.down { color: #ef4444; }
.trend-indicator.neutral { color: #6b7280; }

.trend-indicator .arrow {
  font-size: 18px;
  line-height: 1;
}

/* Match the icon container exactly to the pill's logic but scaled up */
.metric-summary-card .stat-pill-icon-container {
  position: static; /* Removed absolute positioning */
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .metric-summary-card .stat-pill-icon-container {
    width: 72px;
    height: 72px;
  }
}

.metric-summary-card .stat-pill-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Left aligned text inside the card */
  justify-content: center;
}

.metric-summary-card .stat-icon {
  font-size: 24px !important;
}

@media (min-width: 768px) {
  .metric-summary-card .stat-icon {
    font-size: 32px !important;
  }
}

/* Chart Section */
.drawer-chart-section {
  margin: 24px 0;
  padding: 20px;
  background: var(--modern-card-background);
  border-radius: 16px;
  border: 1px solid var(--brokerly-border-medium);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chart-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  margin: 0 0 16px 0;
}

.drawer-chart-section .ai-chart-container {
  position: relative;
  width: 100%;
  min-height: 250px;
  max-height: 300px;
}

.drawer-chart-section .ai-chart {
  width: 100% !important;
  height: 250px !important;
}

/* Budget Button */
.set-budget-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  margin: 24px 0 16px 0;
  background: var(--clive-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px var(--clive-glow);
}

.set-budget-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--clive-glow);
}

.set-budget-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.set-budget-btn svg {
  flex-shrink: 0;
}

.budget-usage-bar {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--brokerly-border-light);
}

.budget-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.budget-label-text {
  font-size: 13px;
  color: var(--brokerly-text-secondary);
  font-weight: 500;
}

.budget-percentage {
  font-size: 13px;
  font-weight: 600;
  color: #10b981;
}

.budget-percentage.over-budget {
  color: #ef4444;
}

.budget-progress-bar {
  height: 8px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
}

.budget-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  transition: width 0.3s ease;
  border-radius: 4px;
}

.budget-progress-fill.over-budget {
  background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

/* Vendor Stats */
.vendor-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--brokerly-border-light);
}

.vendor-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vendor-stat-label {
  font-size: 12px;
  color: var(--brokerly-text-secondary);
  font-weight: 500;
}

.vendor-stat-value {
  font-size: 16px;
  color: var(--brokerly-text-primary);
  font-weight: 600;
}

/* Transaction Summary Card */
.transaction-summary-card {
  background: var(--modern-card-background);
  border: 1px solid var(--brokerly-border-light);
  border-radius: 16px;
  padding: 24px;
  margin: 16px 0;
  text-align: center;
}

.transaction-vendor-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  margin-bottom: 12px;
}

.transaction-main-amount {
  font-size: 32px;
  font-weight: 700;
  color: var(--brokerly-warm-red);
  margin: 8px 0;
}

.transaction-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.transaction-category-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--brokerly-primary-light);
  color: var(--brokerly-text-secondary);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}

.transaction-date-text {
  font-size: 13px;
  color: var(--brokerly-text-secondary);
  font-weight: 500;
}

/* Transaction Details Section */
.transaction-details-section .detail-list {
  background: var(--modern-card-background);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--brokerly-border-light);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--brokerly-border-light);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 14px;
  color: var(--brokerly-text-secondary);
  font-weight: 500;
}

.detail-value {
  font-size: 14px;
  color: var(--brokerly-text-primary);
  font-weight: 600;
  text-align: right;
}

.detail-value.status-completed {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--brokerly-warm-green);
}

.detail-value.status-completed svg {
  flex-shrink: 0;
}

.detail-value.transaction-id {
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  color: var(--brokerly-text-secondary);
}

/* Transaction Section */
.transaction-section {
  margin: 16px 0;
}

.transaction-section .section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
  margin: 0 0 12px 0;
}

.transaction-list {
  background: var(--modern-card-background);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--brokerly-border-light);
}

.transaction-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--brokerly-border-light);
  cursor: pointer;
  transition: background 0.2s;
}

.transaction-row:last-child {
  border-bottom: none;
}

.transaction-row:hover {
  background: var(--brokerly-secondary-background);
}

.transaction-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.transaction-vendor {
  font-size: 14px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

.transaction-date {
  font-size: 12px;
  color: var(--brokerly-text-secondary);
}

.transaction-amount {
  font-size: 15px;
  font-weight: 600;
  color: var(--brokerly-warm-red);
  white-space: nowrap;
  margin-left: 12px;
}

.no-data {
  padding: 24px;
  text-align: center;
  color: var(--brokerly-text-secondary);
  font-size: 14px;
}

/* Transaction Header Card (matching iOS) */
.transaction-header-card {
  background: linear-gradient(135deg, #f6f8fb 0%, #ffffff 100%);
  border: 1px solid var(--brokerly-border-light);
  border-radius: 16px;
  padding: 32px 24px;
  margin: 16px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.transaction-amount-large {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.transaction-amount-large.income {
  color: #10b981;
}

.transaction-amount-large.expense {
  color: #111827;
}

.transaction-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 600;
}

.transaction-type-badge.income {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.transaction-type-badge.expense {
  background: rgba(251, 146, 60, 0.1);
  color: #f97316;
}

.transaction-type-badge svg {
  flex-shrink: 0;
}

/* Transaction Details Card (matching iOS with icons) */
.transaction-details-card {
  background: var(--modern-card-background);
  border: 1px solid var(--brokerly-border-light);
  border-radius: 16px;
  padding: 20px;
  margin: 16px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.transaction-detail-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.transaction-detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--brokerly-border-light);
}

.transaction-detail-row:last-child {
  border-bottom: none;
}

.detail-icon {
  flex-shrink: 0;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
}

.detail-icon svg {
  width: 16px;
  height: 16px;
}

.transaction-detail-row .detail-label {
  flex-shrink: 0;
  width: 100px;
  font-size: 14px;
  color: var(--brokerly-text-secondary);
  font-weight: 500;
}

.transaction-detail-row .detail-value {
  flex: 1;
  font-size: 15px;
  color: var(--brokerly-text-primary);
  font-weight: 400;
  text-align: left;
}

/* AI Analysis Section (matching iOS) */
.ai-analysis-section {
  background: var(--modern-card-background);
  border: 1px solid var(--brokerly-border-light);
  border-radius: 16px;
  padding: 20px;
  margin: 16px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-analysis-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.ai-analysis-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--modern-card-background);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ai-analysis-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-analysis-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.analysis-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

.analysis-subtitle {
  font-size: 14px;
  color: var(--brokerly-text-secondary);
}

.ai-analysis-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analysis-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analysis-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--brokerly-text-secondary);
}

.analysis-text {
  font-size: 15px;
  color: var(--brokerly-text-primary);
  line-height: 1.6;
}

/* Transaction Action Buttons (matching iOS) */
.transaction-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.transaction-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.transaction-action-btn.primary {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.transaction-action-btn.primary:hover {
  background: rgba(59, 130, 246, 0.15);
  transform: translateY(-1px);
}

.transaction-action-btn.primary:active {
  transform: translateY(0);
}

.transaction-action-btn svg {
  flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ai-insight-bubble {
    padding: 14px;
    gap: 10px;
  }

  .ai-avatar {
    width: 32px;
    height: 32px;
  }

  .current-value {
    font-size: 32px;
  }

  .drawer-chart-section .ai-chart {
    height: 220px !important;
  }

  .transaction-main-amount {
    font-size: 28px;
  }

  .vendor-stats {
    gap: 8px;
  }

  .transaction-amount-large {
    font-size: 34px;
  }

  .transaction-header-card {
    padding: 24px 16px;
  }

  .transaction-detail-row .detail-label {
    width: 80px;
    font-size: 13px;
  }

  .transaction-detail-row .detail-value {
    font-size: 14px;
  }

  /* Tender Detail Sheet Mobile Specifics */
  .tender-detail-sheet .sheet-content {
    max-height: 60vh;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), height 0.3s ease !important;
  }

  .tender-detail-sheet.maximized .sheet-content {
    max-height: 80vh !important;
    height: 80vh !important;
  }
}

/* Tender Detail Styles */
/* Tender Summary Card - New Modern Layout */
.tender-summary-card {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(79, 70, 229, 0.06) 100%);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: 24px;
  padding: 32px 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.tender-summary-card .summary-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tender-summary-card .category-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--brokerly-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tender-summary-card .tender-status-badge {
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.tender-title-large {
  font-size: 28px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
  margin: 0;
  line-height: 1.25;
}

.tender-summary-card .budget-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--brokerly-border-light);
}

.tender-summary-card .budget-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
}

.tender-summary-card .budget-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--brokerly-primary);
}

/* Tender Info Card - Flexible Container */
.tender-info-card {
  background: var(--modern-card-background);
  border: 1px solid var(--brokerly-border-light);
  border-radius: 20px;
  padding: 24px;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tender-info-card .section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--brokerly-text-primary);
  text-transform: none;
  letter-spacing: normal;
}

.tender-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.metric-pill {
  background: var(--modern-card-background);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.metric-pill .metric-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
  margin-bottom: 4px;
}

.metric-pill .metric-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Info Rows */
.info-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}

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

.info-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--brokerly-text-secondary);
}

.info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

/* Bids Timeline */
.bids-timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  margin-top: 16px;
  padding-left: 12px;
}

.timeline-item {
  position: relative;
  padding-left: 28px;
  padding-bottom: 24px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

/* The vertical connecting line */
.timeline-connector {
  position: absolute;
  left: 0;
  top: 24px;
  bottom: -8px;
  /* Extend down to the next dot */
  width: 2px;
  background-color: var(--brokerly-border-medium, #e5e7eb);
}

/* Don't show connector on the last item */
.timeline-item:last-child .timeline-connector {
  display: none;
}

/* The dot marker */
.timeline-marker {
  position: absolute;
  left: -4px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--brokerly-border-medium, #d1d5db);
  border: 2px solid var(--modern-card-background, #ffffff);
  z-index: 1;
}

/* Status Badges */
.bid-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bid-status-badge.won {
  background: rgba(251, 191, 36, 0.15);
  /* amber/gold */
  color: #d97706;
}

.bid-status-badge.accepted {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.bid-status-badge.rejected {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.bid-status-badge.pending {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.bid-card {
  background: var(--modern-card-background);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  position: relative;
}

.bid-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.bid-card.bid-winning {
  border-color: #f59e0b;
  /* Gold border for winning */
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.bid-card.bid-accepted {
  border-color: #10b981;
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.bid-card.bid-rejected {
  opacity: 0.7;
}

.bid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.bid-vendor {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vendor-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--clive-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.vendor-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vendor-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

.vendor-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.rating-text {
  color: var(--brokerly-text-secondary);
}

.bid-amount {
  font-size: 20px;
  font-weight: 700;
  color: #10b981;
}

.bid-proposal {
  margin: 12px 0;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--brokerly-text-secondary);
}

.bid-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--brokerly-text-secondary);
  margin-top: 12px;
}

.bid-time,
.bid-completion {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bid-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.bid-action-button {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.bid-action-button.primary {
  background: var(--clive-gradient);
  color: white;
}

.bid-action-button.primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.bid-action-button.secondary {
  background: var(--modern-card-background);
  color: var(--brokerly-text-primary);
  border: 1px solid #e5e7eb;
}

.bid-action-button.secondary:hover {
  background: #f9fafb;
}

/* Responsive Adjustments for Tender Details */
@media (max-width: 480px) {
  .tender-title-large {
    font-size: 20px;
  }

  .tender-metrics-grid {
    gap: 8px;
  }

  .metric-pill {
    padding: 12px 8px;
  }

  .metric-pill .metric-value {
    font-size: 18px;
  }

  .metric-pill .metric-label {
    font-size: 11px;
  }

  .bid-amount {
    font-size: 18px;
  }

  .vendor-avatar {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

/* Dark Mode Overrides for Transaction Details Sheet */
[data-theme="dark"] .transaction-header-card,
.dark-mode .transaction-header-card {
  background: linear-gradient(135deg, #13141a 0%, #141419 100%) !important;
  border-color: var(--brokerly-border-light) !important;
}

[data-theme="dark"] .transaction-amount-large.expense,
.dark-mode .transaction-amount-large.expense {
  color: var(--brokerly-text-primary) !important;
}

[data-theme="dark"] .transaction-details-card,
.dark-mode .transaction-details-card,
[data-theme="dark"] .ai-analysis-section,
.dark-mode .ai-analysis-section {
  border-color: var(--brokerly-border-light) !important;
}

/* Dark Mode Overrides for Tender Details */
[data-theme="dark"] .metric-summary-card {
  background: var(--pill-bg, var(--modern-card-background)) !important;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .metric-pill,
[data-theme="dark"] .bid-card,
[data-theme="dark"] .bid-action-button.secondary {
  background: var(--modern-card-background);
  border-color: var(--brokerly-border-medium);
}

[data-theme="dark"] .metric-label,
[data-theme="dark"] .info-label,
[data-theme="dark"] .rating-text,
[data-theme="dark"] .bid-meta {
  color: #9ca3af;
}

[data-theme="dark"] .current-value {
  color: #f3f4f6;
}

[data-theme="dark"] .info-row {
  border-bottom: 1px solid var(--brokerly-border-light);
}

[data-theme="dark"] .bid-card.bid-winning {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .bid-proposal {
  background: var(--brokerly-tertiary-background);
  color: var(--brokerly-text-secondary);
}

[data-theme="dark"] .bid-action-button.secondary:hover {
  background: var(--brokerly-tertiary-background);
}

/* Financial Category Analysis Insights */
.insight-mini-card {
  background: var(--brokerly-tertiary-background);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.insight-mini-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--brokerly-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.insight-mini-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insight-mini-sub {
  font-size: 12px;
  color: var(--brokerly-text-tertiary);
}

[data-theme="dark"] .insight-mini-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ========================================================================= */
/* STANDARDIZED RIGHT-SIDE SYSTEM (Edge-to-Edge)                             */
/* ========================================================================= */
/* These are placed at the very end to ensure they take absolute precedence  */
/* over any generic desktop centering rules defined earlier.                 */
@media (min-width: 768px) {
  .slide-up-sheet.right-side-panel .sheet-backdrop {
    background: var(--brokerly-backdrop-bg);
    backdrop-filter: blur(2px);
  }

  /* Force a floating, premium look with 16px margins and rounded corners */
  .slide-up-sheet.right-side-panel .sheet-content {
    position: fixed !important;
    left: auto !important;
    right: 16px !important;
    top: 16px !important;
    bottom: 16px !important;
    width: 624px !important;
    max-width: 90vw !important;
    height: calc(100% / var(--zoom-factor, 0.9) - 32px) !important;
    max-height: calc(100vh / var(--zoom-factor, 0.9) - 32px) !important;
    border-radius: 24px !important;
    border: 1px solid var(--brokerly-border-medium) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
    overflow: hidden !important;

    /* Initial state optimized for smooth entry */
    transform: translateX(calc(100% + 20px)) translateY(0) !important;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), width 0.3s ease !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .slide-up-sheet.active.right-side-panel .sheet-content {
    transform: translateX(0) translateY(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* Maximized state for standardized drawers with margins */
  .slide-up-sheet.active.right-side-panel.maximized .sheet-content {
    width: calc(65% - 32px) !important;
    max-width: calc(65vw - 32px) !important;
  }

  /* Hide the handle on desktop for side panels */
  .slide-up-sheet.right-side-panel .sheet-handle {
    display: none !important;
  }
}

/* ==========================================================================
   Premium Receipt Itemization Styling (Money Transaction Drawer)
   ========================================================================== */
.receipt-items-premium {
  background: var(--brokerly-secondary-background);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
  border: 1px solid var(--brokerly-border-subtle, rgba(255, 255, 255, 0.08));
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.receipt-items-premium:hover {
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.08);
}

.receipt-items-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.receipt-item-grid-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--brokerly-tertiary-background, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--brokerly-border-subtle, rgba(255, 255, 255, 0.04));
  border-radius: 10px;
  transition: all 0.2s ease;
}

.receipt-item-grid-row:hover {
  background: rgba(245, 158, 11, 0.04);
  border-color: rgba(245, 158, 11, 0.2);
  transform: translateX(4px);
}

.receipt-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.receipt-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

.receipt-item-subtitle {
  font-size: 11px;
  color: var(--brokerly-text-tertiary);
}

.receipt-item-total-price {
  font-size: 13px;
  font-weight: 700;
  color: #F59E0B;
}

.receipt-items-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--brokerly-border-medium, rgba(255, 255, 255, 0.1));
}

.receipt-items-summary .summary-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--brokerly-text-secondary);
  letter-spacing: 0.05em;
}

.receipt-items-summary .summary-value {
  font-size: 14px;
  font-weight: 800;
  color: #F59E0B;
}

/* Skeleton Loading State */
.receipt-items-premium.skeleton .skeleton-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.receipt-items-premium.skeleton .skeleton-row {
  height: 40px;
  background: linear-gradient(90deg, 
    var(--brokerly-tertiary-background, rgba(255,255,255,0.03)) 25%, 
    rgba(255, 255, 255, 0.08) 50%, 
    var(--brokerly-tertiary-background, rgba(255,255,255,0.03)) 75%
  );
  background-size: 200% 100%;
  animation: receipt-shimmer 1.5s infinite;
  border-radius: 10px;
}

@keyframes receipt-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Warning block for receipt scan no match */
.no-match-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  color: #EF4444;
  margin-bottom: 16px;
  text-align: left;
}

.no-match-warning .warning-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.no-match-warning .warning-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.no-match-warning .warning-text strong {
  font-size: 13px;
  font-weight: 700;
}

.no-match-warning .warning-text span {
  font-size: 11px;
  color: var(--brokerly-text-secondary);
  line-height: 1.4;
}

/* ==========================================================================
   Financial Drawer — Period Comparison Bars
   ========================================================================== */

.period-comparison {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 auto 24px;
  max-width: 440px;
  width: 95%;
}

.period-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.period-bar-label {
  width: 80px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brokerly-text-secondary);
  text-align: right;
  flex-shrink: 0;
}

.period-bar-fill {
  flex: 1;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--brokerly-tertiary-background);
  position: relative;
  overflow: hidden;
}

.period-bar-fill-inner {
  width: var(--fill-pct, 0%);
  height: 100%;
  border-radius: var(--radius-sm);
  background: var(--bar-color, var(--brokerly-primary));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.period-bar-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
  min-width: 70px;
  text-align: right;
}

.period-bar-delta {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
  align-self: center;
  margin-top: 4px;
}

.period-bar-delta.up {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.period-bar-delta.down {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.period-bar-delta.neutral {
  background: rgba(107, 114, 128, 0.1);
  color: var(--brokerly-text-tertiary);
}

/* ==========================================================================
   Financial Drawer — Breakdown Section
   ========================================================================== */

.breakdown-section {
  padding: 0;
  margin-bottom: 24px;
}

.breakdown-row {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--brokerly-secondary-background);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.breakdown-row:hover {
  transform: scale(1.01);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.breakdown-row:active {
  transform: scale(0.99);
}

.breakdown-row-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.breakdown-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.breakdown-label .breakdown-icon {
  font-size: 18px;
  line-height: 1;
}

.breakdown-label .breakdown-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--brokerly-text-primary);
}

.breakdown-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--brokerly-text-primary);
}

.breakdown-pct {
  font-size: 12px;
  font-weight: 500;
  color: var(--brokerly-text-tertiary);
  margin-left: 6px;
}

.breakdown-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--brokerly-tertiary-background);
  overflow: hidden;
}

.breakdown-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--bar-color, var(--brokerly-primary));
  width: var(--fill-pct, 0%);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.breakdown-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
}

.breakdown-trend.up {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.breakdown-trend.down {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.breakdown-trend.neutral {
  background: rgba(107, 114, 128, 0.1);
  color: var(--brokerly-text-tertiary);
}

/* ==========================================================================
   Financial Drawer — Date-Grouped Transaction Feed
   ========================================================================== */

.tx-feed {
  padding: 0;
}

.tx-date-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 6px;
  border-bottom: 1px solid var(--brokerly-border-light);
  margin-bottom: 4px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--brokerly-secondary-background);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tx-date-header .tx-date-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brokerly-text-secondary);
}

.tx-date-subtotal {
  font-size: 12px;
  font-weight: 600;
  color: var(--brokerly-text-tertiary);
}

/* ==========================================================================
   Dark Mode Overrides — Financial Drawer Components
   ========================================================================== */

[data-theme="dark"] .breakdown-row {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .breakdown-row:hover {
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .period-bar-fill {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .tx-date-header {
  background: var(--brokerly-secondary-background);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .period-bar-delta.up {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

[data-theme="dark"] .period-bar-delta.down {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

[data-theme="dark"] .breakdown-trend.up {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

[data-theme="dark"] .breakdown-trend.down {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

[data-theme="dark"] .breakdown-trend.neutral {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
}

[data-theme="dark"] .period-bar-delta.neutral {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
}

/* ===== Cash Flow Redesign ===== */

.cf-net-flow-bar {
  padding: 0 4px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cf-net-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cf-net-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 90px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brokerly-text-secondary);
}

.cf-net-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.cf-net-icon.income {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.cf-net-icon.expense {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.cf-net-track {
  flex: 1;
  height: 24px;
  background: var(--brokerly-tertiary-background, #f1f5f9);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.cf-net-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.cf-net-fill.income {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.cf-net-fill.expense {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.cf-net-value {
  min-width: 72px;
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cf-net-value.income {
  color: #10b981;
}

.cf-net-value.expense {
  color: #ef4444;
}

.cf-net-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}

.cf-net-summary.positive {
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.cf-net-summary.negative {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.cf-net-summary-icon {
  font-size: 14px;
}

.cf-net-summary strong {
  font-weight: 800;
}

.cf-net-summary-pct {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.8;
}

/* Cash Flow Chart Container */
.cash-flow-chart-container {
  cursor: pointer;
}

/* Dynamic Legend */
.cf-legend {
  display: flex;
  gap: 24px;
  padding: 12px 4px 0;
  flex-wrap: wrap;
}

.cf-legend-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cf-legend-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brokerly-text-secondary);
}

.cf-legend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cf-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--brokerly-tertiary-background, #f1f5f9);
  font-size: 12px;
  font-weight: 500;
  color: var(--brokerly-text-primary);
  transition: all 0.2s ease;
  cursor: default;
}

.cf-legend-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

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

.cf-legend-name {
  white-space: nowrap;
}

/* Dark mode overrides */
[data-theme="dark"] .cf-net-track {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .cf-net-fill.income {
  background: linear-gradient(90deg, #059669, #10b981);
}

[data-theme="dark"] .cf-net-fill.expense {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

[data-theme="dark"] .cf-net-summary.positive {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

[data-theme="dark"] .cf-net-summary.negative {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

[data-theme="dark"] .cf-legend-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .cf-legend-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}