/* Shared styles for portfolio sections (Cash Accounts, Pension Accounts, etc.) */

/* Section container */
.portfolio-section {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

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

.section-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.add-button {
  padding: 0.5rem 1rem;
  background: #3245ff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.add-button:hover {
  background: #2030cc;
}

/* Messages */
.error-message {
  background: #fee;
  color: #c00;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: #666;
}

.section-loading {
  text-align: center;
  padding: 2rem;
  color: #666;
}

/* Account list */
.accounts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.account-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  padding: 1rem;
  background: #f8f9ff;
  border-radius: 8px;
  align-items: center;
}

/* Ensure account-actions stays in the top row (3rd column) */
.account-card > .account-actions {
  grid-column: 3;
  grid-row: 1;
}

/* Make child sections span full width (for investment accounts with positions) */
.account-card > .positions-section {
  grid-column: 1 / -1;
  border-top: 1px solid #e0e0e0;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.account-card > .account-balance:not(:nth-child(2)) {
  grid-column: 1 / -1;
  text-align: left;
  margin-top: 0.5rem;
}

.account-info {
  min-width: 0;
}

.account-name {
  font-weight: 600;
  font-size: 1rem;
}

.account-bank,
.account-provider {
  font-size: 0.85rem;
  color: #666;
}

.account-type {
  font-size: 0.8rem;
  color: #888;
  text-transform: capitalize;
}

.account-interest {
  font-size: 0.8rem;
  color: #3245ff;
}

.account-gains {
  font-size: 0.8rem;
  font-weight: 600;
}

.account-gains.positive {
  color: #16a34a;
}

.account-gains.negative {
  color: #dc2626;
}

.account-shared {
  font-size: 0.8rem;
  color: #ff9800;
  font-weight: 500;
}

.account-balance {
  text-align: right;
}

.balance-native {
  font-weight: 600;
  font-size: 1.1rem;
}

.balance-owned {
  font-size: 0.85rem;
  color: #ff9800;
  font-weight: 500;
}

.balance-converted {
  font-size: 0.85rem;
  color: #666;
}

/* Action buttons */
.account-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
}

.action-btn {
  padding: 0.4rem 0.6rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
}

.update-btn {
  background: #e8f5e9;
  color: #2e7d32;
}

.update-btn:hover {
  background: #c8e6c9;
}

.edit-btn {
  background: #e3f2fd;
  color: #1565c0;
}

.edit-btn:hover {
  background: #bbdefb;
}

.history-btn {
  background: #f3e5f5;
  color: #7b1fa2;
}

.history-btn:hover {
  background: #e1bee7;
}

.delete-btn {
  background: #ffebee;
  color: #c62828;
}

.delete-btn:hover {
  background: #ffcdd2;
}

/* Total section */
.total-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 2px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.total-row-secondary {
  gap: 0.5rem;
}

.total-label {
  font-weight: 500;
  color: #666;
}

.total-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: #3245ff;
}

.total-amount.positive {
  color: #16a34a;
}

.total-amount.negative {
  color: #dc2626;
}

/* Secondary totals (gains/losses) - less prominent */
.total-amount-secondary {
  font-size: 1rem;
  font-weight: 500;
  color: #666;
}

.total-amount-secondary.positive {
  color: #22c55e;
}

.total-amount-secondary.negative {
  color: #ef4444;
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-small {
  max-width: 350px;
}

.modal-large {
  max-width: 600px;
}

.modal-extra-large {
  max-width: 800px;
}

.modal-content h3 {
  margin: 0 0 1rem;
}

.modal-subtitle {
  color: #666;
  margin: -0.5rem 0 1rem;
  font-size: 0.9rem;
}

/* Form styles */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3245ff;
}

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

.shared-row {
  align-items: center;
}

.checkbox-group {
  display: flex;
  align-items: center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.cancel-btn {
  padding: 0.75rem 1rem;
  background: #f5f5f5;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.cancel-btn:hover {
  background: #e0e0e0;
}

.submit-btn {
  padding: 0.75rem 1rem;
  background: #3245ff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.submit-btn:hover {
  background: #2030cc;
}

/* History Modal Styles */
.history-add-section {
  background: #f8f9ff;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.history-add-section h4 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.history-add-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
}

.history-add-form .form-group {
  margin-bottom: 0;
}

.history-add-form label {
  font-size: 0.8rem;
  display: block;
  margin-bottom: 0.25rem;
  line-height: 1.2;
  min-height: 1rem;
}

.history-add-form input {
  padding: 0.5rem;
  font-size: 0.9rem;
}

.add-entry-btn {
  padding: 0.5rem 1rem;
  height: fit-content;
}

.history-list-section h4 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.history-loading,
.history-empty {
  text-align: center;
  padding: 1rem;
  color: #666;
}

.history-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.history-entry {
  display: grid;
  grid-template-columns: 110px 100px 1fr auto;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  align-items: center;
}

/* Investment account history has extra cost_basis column */
.history-entry.investment-history {
  grid-template-columns: 110px 100px 100px 1fr auto;
}

.history-entry:last-child {
  border-bottom: none;
}

.history-date {
  font-size: 0.9rem;
  color: #666;
}

.history-balance {
  font-weight: 600;
}

.history-cost-basis {
  font-weight: 500;
  font-size: 0.9rem;
  color: #555;
}

.history-note {
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-actions {
  display: flex;
  gap: 0.25rem;
}

.history-icon-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  padding: 0;
}

.edit-icon-btn {
  background: #e3f2fd;
  color: #1565c0;
}

.edit-icon-btn:hover {
  background: #bbdefb;
}

.delete-icon-btn {
  background: #ffebee;
  color: #c62828;
}

.delete-icon-btn:hover {
  background: #ffcdd2;
}

.save-btn {
  background: #e8f5e9;
  color: #2e7d32;
}

.save-btn:hover {
  background: #c8e6c9;
}

.cancel-edit-btn {
  background: #f5f5f5;
  color: #666;
}

.cancel-edit-btn:hover {
  background: #e0e0e0;
}

.history-edit-input {
  padding: 0.4rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}

.history-edit-input:focus {
  outline: none;
  border-color: #3245ff;
}

/* Investment Accounts - Mode Tabs */
.mode-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.mode-tab {
  padding: 0.5rem 1rem;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.mode-tab:hover {
  background: #e8e8e8;
}

.mode-tab.active {
  background: #3245ff;
  color: white;
  border-color: #3245ff;
}

/* Investment Account Cards - Unified card layout */
.account-card-investment {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: #f8f9ff;
  border-radius: 8px;
}

.account-summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #dde0ff;
}

.account-card-investment .account-summary:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Positions Section */
.positions-section {
  padding: 0;
  background: transparent;
}

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

.positions-header h4 {
  margin: 0;
  font-size: 1rem;
  color: #333;
}

.positions-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Position Cards */
.position-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  padding: 0.75rem;
  background: white;
  border: 1px solid #e8ebff;
  border-radius: 6px;
  align-items: center;
}

.position-info {
  min-width: 0;
}

.position-symbol {
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
}

.position-name {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.1rem;
}

.position-details {
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.25rem;
}

.position-details .position-quantity {
  margin-right: 0.75rem;
}

/* Position Value Display */
.position-value {
  text-align: right;
}

.position-current-value {
  font-weight: 600;
  font-size: 1rem;
}

.position-gains {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.15rem;
}

.position-gains.positive {
  color: #16a34a;
}

.position-gains.negative {
  color: #dc2626;
}

.position-gains.neutral {
  color: #666;
}

/* Position Actions */
.position-actions {
  display: flex;
  gap: 0.5rem;
}

.view-btn {
  background: #fff3e0;
  color: #e65100;
}

.view-btn:hover {
  background: #ffe0b2;
}

/* Transaction Modal - Add Section */
.transaction-add-section {
  background: #f8f9ff;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.transaction-add-section h4 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.transaction-add-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
}

.transaction-add-form .form-group {
  margin-bottom: 0;
}

.transaction-add-form label {
  font-size: 0.8rem;
}

.transaction-add-form input,
.transaction-add-form select {
  padding: 0.5rem;
  font-size: 0.9rem;
}

/* Transactions List */
.transactions-list-section {
  margin-top: 1.5rem;
}

.transactions-list-section h4 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.transactions-loading,
.transactions-empty {
  text-align: center;
  padding: 1rem;
  color: #666;
}

.transactions-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.transaction-row {
  display: grid;
  grid-template-columns: 100px 80px 100px 90px 1fr auto;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  align-items: center;
}

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

.transaction-info {
  display: contents;
}

.transaction-date {
  font-size: 0.9rem;
  color: #666;
}

.transaction-type {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  text-align: center;
}

.transaction-type.type-buy {
  background: #e8f5e9;
  color: #2e7d32;
}

.transaction-type.type-sell {
  background: #ffebee;
  color: #c62828;
}

.transaction-type.type-price_update {
  background: #e3f2fd;
  color: #1565c0;
}

.transaction-quantity {
  font-size: 0.85rem;
  color: #333;
  font-weight: 500;
}

.transaction-price {
  font-size: 0.85rem;
  color: #333;
  font-weight: 600;
}

.transaction-note {
  font-size: 0.8rem;
  color: #888;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transaction-actions {
  display: flex;
  gap: 0.25rem;
}

/* Small Empty State */
.empty-state-small {
  text-align: center;
  padding: 1rem;
  color: #888;
  font-size: 0.9rem;
}

/* Portfolio Tabs Navigation */
.portfolio-tabs-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.portfolio-tabs-nav {
  display: flex;
  gap: 0.75rem;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 0.5rem;
}

.portfolio-tab {
  flex: 1;
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: #666;
  transition: all 0.2s ease;
  position: relative;
  bottom: -0.5rem;
  text-align: center;
}

.portfolio-tab:hover {
  color: #3245ff;
  background: #f8f9ff;
}

.portfolio-tab.active {
  color: #3245ff;
  border-bottom-color: #3245ff;
  background: transparent;
}

.portfolio-tabs-content {
  display: flex;
  flex-direction: column;
}

.portfolio-tab-panel {
  width: 100%;
}

/* Portfolio Overview Styles */
.portfolio-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.overview-card {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.overview-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: #333;
}

/* Net Worth Premium Card - Hero Style */
.net-worth-premium-card {
  grid-column: span 1;
  background: linear-gradient(135deg, #F9FAFB 0%, #EEF2FF 100%);
  border-radius: 24px;
  padding: 32px 36px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  animation: fadeInUp 0.5s ease-out;
  position: relative;
  overflow: hidden;
}

.net-worth-premium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
}

.net-worth-premium-card:hover {
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

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

.net-worth-label {
  font-size: 15px;
  font-weight: 500;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.net-worth-hero {
  font-size: 40px;
  font-weight: 700;
  color: #3A54E8;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.gains-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 20px;
}

.gains-row.positive {
  color: #16a34a;
}

.gains-row.negative {
  color: #dc2626;
}

.gains-icon {
  font-size: 20px;
  line-height: 1;
}

.gains-text {
  line-height: 1;
}

.snapshot-info {
  font-size: 14px;
  color: #9CA3AF;
  line-height: 1.5;
}

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

.snapshot-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.refresh-snapshot-btn,
.backfill-snapshot-btn {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
  color: #3b82f6;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.refresh-snapshot-btn:hover:not(:disabled),
.backfill-snapshot-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.refresh-snapshot-btn:disabled,
.backfill-snapshot-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.refresh-snapshot-btn:disabled {
  animation: spin 1s linear infinite;
}

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

.snapshot-message {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
  animation: fadeIn 0.3s ease;
}

.snapshot-message.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #059669;
}

.snapshot-message.error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

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

/* Quick Stats Premium Card - 2×2 Grid */
.quick-stats-premium-card {
  grid-column: span 1;
  background: linear-gradient(135deg, #F9FAFB 0%, #EEF2FF 100%);
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  animation: fadeInUp 0.5s ease-out 0.1s backwards;
  position: relative;
  overflow: hidden;
}

.quick-stats-premium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
}

.quick-stats-premium-card:hover {
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

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

.stat-tile {
  background: linear-gradient(135deg, #F3F4FF 0%, #F9FAFB 100%);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.2s ease, transform 0.15s ease;
}

.stat-tile:hover {
  background: linear-gradient(135deg, #E8EAFF 0%, #F3F4FF 100%);
  transform: translateY(-1px);
}

.stat-tile-label {
  font-size: 12px;
  font-weight: 500;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-tile-value {
  font-size: 24px;
  font-weight: 700;
  color: #3A54E8;
  line-height: 1.2;
}

.stat-tile-value.stat-tile-text {
  font-size: 18px;
  font-weight: 600;
  color: #1E293B;
}

.stat-tile-value.stat-tile-currency {
  font-size: 20px;
  color: #3A54E8;
}

.stat-tile-value.stat-tile-positive {
  color: #16a34a;
}

.stat-tile-value.stat-tile-negative {
  color: #dc2626;
}

/* Net Performance Premium Card */
.performance-premium-card {
  grid-column: span 2;
  background: linear-gradient(135deg, #F9FAFB 0%, #EEF2FF 100%);
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  animation: fadeInUp 0.5s ease-out 0.15s backwards;
  position: relative;
  overflow: hidden;
}

.performance-premium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
}

.performance-premium-card:hover {
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.performance-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.performance-tile {
  background: linear-gradient(135deg, #F9FAFB 0%, #F3F4FF 100%);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.performance-tile:hover {
  background: linear-gradient(135deg, #F3F4FF 0%, #E8EAFF 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(58, 84, 232, 0.08);
}

.performance-tile-label {
  font-size: 13px;
  font-weight: 500;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.performance-tile-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.performance-tile-value.positive {
  color: #16a34a;
}

.performance-tile-value.negative {
  color: #dc2626;
}

.performance-tile-value.performance-no-data {
  color: #94A3B8;
  font-size: 32px;
}

.performance-icon {
  font-size: 24px;
  line-height: 1;
}

.performance-tile-date {
  font-size: 12px;
  color: #64748B;
  font-weight: 500;
  margin-top: 4px;
}

/* Premium Distribution Card - Modern Fintech Style */
.distribution-premium-card {
  grid-column: span 2;
  background: linear-gradient(135deg, #F9FAFB 0%, #EEF2FF 100%);
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  animation: fadeInUp 0.5s ease-out 0.15s backwards;
  position: relative;
  overflow: hidden;
}

.distribution-premium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 33%, #ec4899 66%, #f59e0b 100%);
}

.distribution-premium-card:hover {
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.premium-card-title {
  margin: 0 0 20px;
  font-size: 22px;
  font-weight: 600;
  color: #0F172A;
  letter-spacing: -0.01em;
}

.donut-chart-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.chart-wrapper {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-chart {
  width: 240px;
  height: 240px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.05));
  animation: fadeInScale 0.6s ease-out;
}

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

.donut-segment {
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform-origin: center;
}

.donut-segment:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

/* Chart Legend - Modern Fintech Style */
.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.15s ease;
}

.legend-row:hover {
  background: #F8FAFC;
  transform: translateX(2px);
}

.legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.legend-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #334155;
}

.legend-category {
  font-weight: 500;
  color: #1E293B;
}

.legend-separator {
  color: #94A3B8;
}

.legend-amount {
  font-weight: 400;
  color: #475569;
}

.legend-percentage {
  font-weight: 400;
  color: #64748B;
  font-size: 14px;
}

/* Quick Stats Card */
.stats-card {
  grid-column: span 1;
  display: flex;
  flex-direction: column;
}

/* Timeline Premium Card */
.timeline-premium-card {
  grid-column: span 2;
  background: linear-gradient(135deg, #F9FAFB 0%, #EEF2FF 100%);
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  animation: fadeInUp 0.5s ease-out 0.2s backwards;
  position: relative;
  overflow: hidden;
}

.timeline-premium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
}

.timeline-premium-card:hover {
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.timeline-chart-container {
  margin-top: 16px;
}

.timeline-chart {
  width: 100%;
  height: auto;
  max-width: 100%;
}

.timeline-point {
  transition: r 0.2s ease, stroke-width 0.2s ease;
  cursor: pointer;
}

.timeline-point:hover {
  r: 7;
  stroke-width: 3;
}

.timeline-empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: #475569;
  margin: 0 0 8px;
}

.empty-state-description {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
}

/* Interactive Timeline Styles */
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
}

.timeline-title-group {
  flex: 1;
  min-width: 0;
}

.timeline-subtitle {
  font-size: 14px;
  color: #64748B;
  font-weight: 400;
  margin-top: 4px;
}

/* Time Range Selector */
.time-range-selector {
  display: flex;
  gap: 4px;
  background: #F1F5F9;
  border-radius: 8px;
  padding: 3px;
}

.time-range-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #64748B;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.time-range-btn:hover {
  color: #3A54E8;
  background: rgba(58, 84, 232, 0.08);
}

.time-range-btn.active {
  color: #FFFFFF;
  background: #3A54E8;
  box-shadow: 0 2px 4px rgba(58, 84, 232, 0.2);
}

/* Series Toggles */
.series-toggles {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.series-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #64748B;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.series-toggle:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}

.series-toggle.active {
  color: #FFFFFF;
  background: var(--series-color);
  border-color: var(--series-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.toggle-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

.series-toggle.active .toggle-indicator {
  opacity: 1;
  background: #FFFFFF;
}

/* Timeline Chart Wrapper */
.timeline-chart-wrapper {
  margin-top: 20px;
  position: relative;
}

.timeline-chart-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.timeline-line {
  transition: opacity 0.2s ease;
}

.timeline-area {
  transition: opacity 0.2s ease;
}

.timeline-point {
  transition: all 0.2s ease;
}

.timeline-point:hover {
  filter: brightness(1.1);
}

/* Timeline Tooltip */
.timeline-tooltip-content {
  background: #FFFFFF;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border: 1px solid #E2E8F0;
  min-width: 180px;
  pointer-events: none;
}

.tooltip-date {
  font-size: 13px;
  font-weight: 600;
  color: #1E293B;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #F1F5F9;
}

.tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

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

.tooltip-label {
  font-size: 12px;
  color: #64748B;
  flex: 1;
  min-width: 0;
}

.tooltip-value {
  font-size: 12px;
  font-weight: 600;
  color: #1E293B;
  white-space: nowrap;
}

/* Currency Distribution Premium Card */
.currency-premium-card {
  grid-column: span 1;
  background: linear-gradient(135deg, #F9FAFB 0%, #EEF2FF 100%);
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  animation: fadeInUp 0.5s ease-out 0.22s backwards;
  position: relative;
  overflow: hidden;
}

.currency-premium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #10b981 0%, #3b82f6 33%, #f59e0b 66%, #ef4444 100%);
}

.currency-premium-card:hover {
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

/* Risk Score Premium Card */
.risk-score-premium-card {
  grid-column: span 1;
  background: linear-gradient(135deg, #F9FAFB 0%, #EEF2FF 100%);
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  animation: fadeInUp 0.5s ease-out 0.2s backwards;
  position: relative;
  overflow: hidden;
}

.risk-score-premium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
}

.risk-score-premium-card:hover {
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.premium-card-title-with-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.premium-card-title-with-info .premium-card-title {
  margin: 0;
}

.info-tooltip-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
}

.info-icon {
  font-size: 16px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.info-tooltip-container:hover .info-icon {
  opacity: 1;
}

.info-tooltip {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  background: #1E293B;
  color: #FFFFFF;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  width: 280px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 10;
  pointer-events: none;
}

.info-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #1E293B;
}

.info-tooltip-container:hover .info-tooltip {
  opacity: 1;
  visibility: visible;
}

.risk-score-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.risk-gauge-container {
  width: 100%;
  max-width: 220px;
}

.risk-gauge {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
}

/* Risk level pill with colored backgrounds and integrated score */
.risk-level-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  border-radius: 24px;
  font-weight: 600;
  text-align: center;
  margin-top: -5px;
  transition: transform 0.2s ease;
}

.risk-level-pill:hover {
  transform: scale(1.05);
}

.risk-pill-score {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.risk-pill-separator {
  font-size: 14px;
  opacity: 0.5;
  line-height: 1;
}

.risk-pill-label {
  font-size: 15px;
  line-height: 1;
}

.risk-level-pill.risk-level-veryLow {
  background: rgba(22, 163, 74, 0.15);
  color: #16a34a;
}

.risk-level-pill.risk-level-low {
  background: rgba(132, 204, 22, 0.15);
  color: #65a30d;
}

.risk-level-pill.risk-level-moderate {
  background: rgba(234, 179, 8, 0.15);
  color: #ca8a04;
}

.risk-level-pill.risk-level-high {
  background: rgba(249, 115, 22, 0.15);
  color: #ea580c;
}

.risk-level-pill.risk-level-veryHigh {
  background: rgba(220, 38, 38, 0.15);
  color: #dc2626;
}

/* Risk comparison container (Scenario A) - Improved visual hierarchy */
.risk-comparison-container {
  margin-top: 8px;
  padding: 16px 18px;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}

.risk-comparison-container.comparison-aligned {
  background: rgba(22, 163, 74, 0.08);
  border-left: 3px solid #16a34a;
}

.risk-comparison-container.comparison-higher {
  background: rgba(249, 115, 22, 0.08);
  border-left: 3px solid #ea580c;
}

.risk-comparison-container.comparison-lower {
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid #3b82f6;
}

.comparison-icon {
  font-size: 20px;
  line-height: 1;
  margin-top: 2px;
  flex-shrink: 0;
}

.comparison-content {
  flex: 1;
}

.comparison-message {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: #1E293B;
}

.comparison-message strong {
  font-weight: 700;
  color: #0F172A;
}

.comparison-aligned .comparison-message {
  color: #166534;
}

.comparison-aligned .comparison-message strong {
  color: #15803d;
}

.comparison-higher .comparison-message {
  color: #9a3412;
}

.comparison-higher .comparison-message strong {
  color: #c2410c;
}

.comparison-lower .comparison-message {
  color: #1e40af;
}

.comparison-lower .comparison-message strong {
  color: #2563eb;
}

.comparison-advisory {
  font-size: 13px;
  color: #64748B;
  margin-top: 8px;
  font-style: italic;
  line-height: 1.5;
}

/* CTA section (Scenario B) */
.risk-cta-section {
  margin-top: 16px;
  text-align: center;
}

.risk-incomplete-text {
  font-size: 13px;
  color: #64748B;
  margin-bottom: 12px;
}

.risk-cta-button {
  display: inline-block;
  padding: 10px 24px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: #FFFFFF;
  text-decoration: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.risk-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

.risk-cta-hint {
  font-size: 12px;
  color: #9CA3AF;
  margin-top: 10px;
  line-height: 1.4;
}

/* Empty state (Scenario C) */
.risk-score-empty-state {
  padding: 20px;
  text-align: center;
}

.empty-state-message {
  font-size: 14px;
  color: #64748B;
  margin-bottom: 20px;
  line-height: 1.5;
}

.questionnaire-fallback {
  padding: 16px;
  background: rgba(59, 130, 246, 0.05);
  border-radius: 12px;
  border: 1px dashed #3b82f6;
}

.questionnaire-label {
  font-size: 12px;
  color: #64748B;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.questionnaire-score-display {
  font-size: 18px;
  font-weight: 700;
  color: #3b82f6;
}

/* Liquidity Distribution Premium Card */
.liquidity-premium-card {
  grid-column: span 1;
  background: linear-gradient(135deg, #F9FAFB 0%, #EEF2FF 100%);
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  animation: fadeInUp 0.5s ease-out 0.25s backwards;
  position: relative;
  overflow: hidden;
}

.liquidity-premium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #16a34a 0%, #eab308 50%, #dc2626 100%);
}

.liquidity-premium-card:hover {
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.liquidity-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.liquidity-row {
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  align-items: center;
  gap: 16px;
}

.liquidity-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.liquidity-icon {
  font-size: 18px;
  line-height: 1;
}

.liquidity-type {
  font-size: 14px;
  font-weight: 600;
  color: #1E293B;
}

.liquidity-bar-container {
  height: 12px;
  background: rgba(226, 232, 240, 0.5);
  border-radius: 6px;
  overflow: hidden;
}

.liquidity-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}

.liquidity-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.liquidity-amount {
  font-size: 14px;
  font-weight: 700;
  color: #1E293B;
}

.liquidity-percentage {
  font-size: 12px;
  font-weight: 500;
  color: #64748B;
}

/* Top 3 Accounts Premium Card - Podium Design */
.top-accounts-premium-card {
  grid-column: span 1;
  background: linear-gradient(135deg, #F9FAFB 0%, #EEF2FF 100%);
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  animation: fadeInUp 0.5s ease-out 0.3s backwards;
  position: relative;
  overflow: hidden;
}

.top-accounts-premium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 50%, #f97316 100%);
}

.top-accounts-premium-card:hover {
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

/* Podium Container */
.podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  padding-bottom: 0;
}

/* Podium Columns */
.podium-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px 24px;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.podium-column:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Podium Heights */
.podium-tall {
  min-height: 280px;
  z-index: 3;
}

.podium-medium {
  min-height: 240px;
  z-index: 2;
}

.podium-short {
  min-height: 200px;
  z-index: 1;
}

/* Podium Colors - Gold */
.podium-gold {
  background: linear-gradient(180deg,
    rgba(251, 191, 36, 0.15) 0%,
    rgba(245, 158, 11, 0.08) 100%);
  border: 2px solid rgba(251, 191, 36, 0.3);
}

.podium-gold .podium-rank {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

/* Podium Colors - Silver */
.podium-silver {
  background: linear-gradient(180deg,
    rgba(148, 163, 184, 0.15) 0%,
    rgba(100, 116, 139, 0.08) 100%);
  border: 2px solid rgba(148, 163, 184, 0.3);
}

.podium-silver .podium-rank {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
  box-shadow: 0 4px 12px rgba(148, 163, 184, 0.4);
}

/* Podium Colors - Bronze */
.podium-bronze {
  background: linear-gradient(180deg,
    rgba(217, 119, 6, 0.15) 0%,
    rgba(180, 83, 9, 0.08) 100%);
  border: 2px solid rgba(217, 119, 6, 0.3);
}

.podium-bronze .podium-rank {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4);
}

/* Podium Rank Badge */
.podium-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: #FFFFFF;
  font-size: 20px;
  font-weight: 700;
  border-radius: 50%;
  margin-bottom: 16px;
  flex-shrink: 0;
}

/* Podium Content */
.podium-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  width: 100%;
}

.podium-balance {
  font-size: 20px;
  font-weight: 700;
  color: #1E293B;
  margin-bottom: 4px;
}

.podium-name {
  font-size: 14px;
  font-weight: 600;
  color: #1E293B;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.podium-type {
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.currency-breakdown {
  margin-top: 16px;
}

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

.currency-row {
  display: grid;
  grid-template-columns: 140px 1fr 60px;
  gap: 16px;
  align-items: center;
}

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

.currency-code {
  font-size: 16px;
  font-weight: 600;
  color: #1E293B;
  letter-spacing: 0.02em;
}

.currency-amount {
  font-size: 14px;
  color: #64748B;
  font-weight: 500;
}

.currency-bar-container {
  height: 12px;
  background: #F1F5F9;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.currency-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
  border-radius: 6px;
  transition: width 0.6s ease-out;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.currency-percentage {
  font-size: 15px;
  font-weight: 600;
  color: #475569;
  text-align: right;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: #f8f9ff;
  border-radius: 8px;
}

.stat-label {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #3245ff;
}

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

  .history-add-form .form-group:nth-child(3) {
    grid-column: span 2;
  }

  .add-entry-btn {
    grid-column: span 2;
  }

  .history-entry {
    grid-template-columns: 1fr 1fr 1fr auto;
  }

  /* Investment history on mobile: only show date, balance, actions */
  .history-entry.investment-history {
    grid-template-columns: 1fr 1fr auto;
  }

  /* Hide cost_basis and note on mobile for investment history (view mode) */
  .history-entry.investment-history .history-cost-basis,
  .history-entry.investment-history .history-note {
    display: none;
  }

  /* Hide cost_basis and note inputs on mobile for investment history (edit mode) */
  /* In edit mode: date input, balance input, cost_basis input (hide), note input (hide), actions div */
  .history-entry.investment-history input:nth-child(3),
  .history-entry.investment-history input:nth-child(4) {
    display: none;
  }

  .history-note {
    display: none;
  }

  .history-edit-input {
    font-size: 0.8rem;
    padding: 0.3rem;
  }

  .account-card {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .account-balance {
    text-align: left;
  }

  .account-actions {
    justify-content: flex-start;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* Investment Accounts - Mobile Responsive */
  .account-summary {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .position-card {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .position-value {
    text-align: left;
  }

  .position-actions {
    justify-content: flex-start;
  }

  .transaction-add-form {
    grid-template-columns: 1fr 1fr;
  }

  .transaction-add-form .form-group:nth-child(3),
  .transaction-add-form .form-group:nth-child(4) {
    grid-column: span 2;
  }

  .add-entry-btn {
    grid-column: span 2;
  }

  .transaction-row {
    grid-template-columns: 1fr 1fr auto;
  }

  .transaction-info {
    display: contents;
  }

  /* Hide quantity and note on mobile */
  .transaction-quantity,
  .transaction-note {
    display: none;
  }

  .transaction-actions {
    justify-content: flex-end;
  }

  /* Portfolio Tabs - Mobile Responsive */
  .portfolio-tabs-nav {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .portfolio-tab {
    flex: 1 1 auto;
    min-width: 100px;
  }

  /* Portfolio Overview - Mobile Responsive */
  .portfolio-overview {
    grid-template-columns: 1fr;
  }

  .net-worth-premium-card,
  .quick-stats-premium-card,
  .distribution-premium-card,
  .timeline-premium-card,
  .currency-premium-card,
  .performance-premium-card,
  .risk-score-premium-card,
  .liquidity-premium-card,
  .top-accounts-premium-card {
    grid-column: span 1;
  }

  .net-worth-premium-card,
  .quick-stats-premium-card {
    padding: 24px 28px;
  }

  .net-worth-hero {
    font-size: 32px;
  }

  .gains-row {
    font-size: 16px;
    margin-bottom: 16px;
  }

  .gains-icon {
    font-size: 18px;
  }

  .snapshot-info {
    font-size: 13px;
  }

  .distribution-premium-card,
  .timeline-premium-card,
  .currency-premium-card,
  .performance-premium-card,
  .risk-score-premium-card,
  .liquidity-premium-card,
  .top-accounts-premium-card {
    padding: 20px 24px;
  }

  .premium-card-title {
    font-size: 20px;
    margin-bottom: 16px;
  }

  /* Podium - Mobile: Stack vertically in 1-2-3 order */
  .podium-container {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .podium-column {
    min-height: auto !important;
    padding: 20px 16px;
    border-radius: 12px;
  }

  /* Reorder for mobile: 1, 2, 3 top to bottom */
  .podium-gold {
    order: 1;
  }

  .podium-silver {
    order: 2;
  }

  .podium-bronze {
    order: 3;
  }

  .podium-balance {
    font-size: 18px;
  }

  /* Liquidity rows - Mobile */
  .liquidity-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .liquidity-label {
    justify-content: flex-start;
  }

  .liquidity-stats {
    align-items: flex-start;
    flex-direction: row;
    justify-content: space-between;
  }

  .performance-tiles {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 16px;
  }

  .performance-tile {
    padding: 16px 20px;
  }

  .performance-tile-value {
    font-size: 24px;
  }

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

  .donut-chart-container {
    flex-direction: column;
    gap: 24px;
  }

  .donut-chart {
    width: 200px;
    height: 200px;
  }

  .chart-legend {
    width: 100%;
  }

  .legend-text {
    font-size: 14px;
  }

  .currency-row {
    grid-template-columns: 110px 1fr 50px;
    gap: 12px;
  }

  .currency-code {
    font-size: 15px;
  }

  .currency-amount {
    font-size: 13px;
  }

  .currency-percentage {
    font-size: 14px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .net-worth-amount {
    font-size: 2rem;
  }

  /* Interactive Timeline - Mobile */
  .timeline-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .time-range-selector {
    justify-content: center;
  }

  .time-range-btn {
    padding: 5px 12px;
    font-size: 12px;
  }

  .series-toggles {
    gap: 6px;
  }

  .series-toggle {
    padding: 6px 12px;
    font-size: 12px;
  }

  .timeline-chart-wrapper {
    margin-top: 16px;
  }

  .timeline-tooltip-content {
    min-width: 150px;
    padding: 10px 12px;
  }

  .tooltip-date {
    font-size: 12px;
    margin-bottom: 8px;
    padding-bottom: 6px;
  }

  .tooltip-row {
    padding: 3px 0;
  }

  .tooltip-label,
  .tooltip-value {
    font-size: 11px;
  }
}
