
/* ===== Stocks Cards Layout ===== */
/* === Allocation View Switch (Sectors/Countries) === */
.allocation-switch-wrapper {
  display: flex;
  justify-content: center;
  margin: 2.2rem 0 1.2rem 0;
  width: 100%;
}

.allocation-switch {
  position: relative;
  display: inline-flex;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(18px);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50px;
  padding: 0.35rem 0.5rem;
  gap: 0.4rem;
  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.35),
    inset 0 2px 6px rgba(255, 255, 255, 0.3);
}

.allocation-option {
  position: relative;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.35rem;
  border-radius: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  transition:
    color 0.35s ease,
    transform 0.35s ease;
  letter-spacing: 0.3px;
}

.allocation-option .option-icon svg {
  display: block;
}

.allocation-option.active {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.allocation-option:not(.active):hover {
  color: rgba(255, 255, 255, 0.95);
}

.switch-glow {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  width: calc(50% - 8px);
  background: linear-gradient(135deg, var(--stocks-row-grad-start) 0%, var(--stocks-row-grad-end) 100%);
  border-radius: 40px;
  box-shadow:
    0 8px 25px rgba(102, 126, 234, 0.5),
    inset 0 0 0 2px rgba(255, 255, 255, 0.25);
  transition:
    transform 0.5s cubic-bezier(0.77, 0, 0.175, 1),
    width 0.3s ease;
  z-index: 0;
}

.allocation-switch .allocation-option {
  z-index: 1;
}

.allocation-switch.sectors-active .switch-glow {
  transform: translateX(0);
}
.allocation-switch.countries-active .switch-glow {
  transform: translateX(100%);
}
/* Dividends switch: mirror Allocation behavior */
.allocation-switch.monthly-active .switch-glow {
  transform: translateX(0);
}
.allocation-switch.annual-active .switch-glow {
  transform: translateX(100%);
}
/* Admin submenu: Snapshots vs Users */
.allocation-switch.snapshots-active .switch-glow {
  transform: translateX(0);
}
.allocation-switch.users-active .switch-glow {
  transform: translateX(100%);
}

/* ===== Admin: Delete Range inputs and button ===== */
#admin-section .admin-range .admin-input {
  flex: 1 1 40%; /* allow shrink/grow while targeting ~40% */
  max-width: calc(50% - 8px); /* ensure stays within panel */
  min-width: 160px; /* avoid too-small inputs on narrow screens */
  box-sizing: border-box;
}
#admin-section .admin-range {
  display: flex;
  align-items: center;
  gap: 0.2rem; /* reduce spacing ~80% */
  flex-wrap: wrap; /* prevent overflow outside panel */
}
#admin-section #delete-range-btn {
  min-width: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px; /* emoji icon size */
}

/* ===== Admin: Snapshot Stats panels sizing ===== */
#admin-section .snapshots-stats.compact .stat-card.mini {
  transform: scale(0.8);
  transform-origin: top left;
}
#admin-section #snapshots-stats-panel {
  /* Place on same row and set width */
  flex: 0 0 50%;
  max-width: 50%;
}

/* Place Delete Range panel on same row and reduce width by 50% */
#admin-section #delete-range-panel {
  flex: 0 0 50%;
  max-width: 50%;
}

/* Enlarge fonts inside Snapshot Stats panel */
#admin-section #snapshots-stats-panel .panel-zone-title {
  font-size: 1.25rem;
}
#admin-section #snapshots-stats-panel .snapshots-stats.compact .stat-card.mini .stat-label {
  font-size: 0.95rem;
}
#admin-section #snapshots-stats-panel .snapshots-stats.compact .stat-card.mini span#total-snapshots-count,
#admin-section #snapshots-stats-panel .snapshots-stats.compact .stat-card.mini span#snapshots-date-range,
#admin-section #snapshots-stats-panel .snapshots-stats.compact .stat-card.mini span#snapshots-size {
  font-size: 1.1rem;
  font-weight: 700;
}

@media (max-width: 600px) {
  .allocation-option {
    padding: 0.55rem 1rem;
    font-size: 0.75rem;
  }
}

/* === New Vertical Allocation Layout === */
.allocation-container.vertical-layout {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  gap: 2.2rem;
  padding: 0 1rem 2rem 1rem;
}

.allocation-stats.vertical-list {
  flex: 0 0 322px; /* reduced by ~25% from 430px */
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.allocation-list-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  max-height: 460px;
}

.allocation-list-vertical::-webkit-scrollbar {
  width: 8px;
}
.allocation-list-vertical::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}
.allocation-list-vertical::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--stocks-row-grad-start), var(--stocks-row-grad-end));
  border-radius: 10px;
}

.allocation-list-vertical > div {
  border-left-width: 4px !important;
}

/* Darker allocation items (~40% more dark vs previous) */
.allocation-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.2rem 0.4rem;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transition: none;
}
.allocation-item:hover {
  background: transparent;
  transform: none;
  box-shadow: none;
  border-color: transparent;
}
.allocation-item .allocation-name {
  color: #cfd3da;
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.2px;
  line-height: 1.1;
}
.allocation-item .allocation-percentage {
  color: #cfd3da;
  font-weight: 400;
  font-size: 0.85rem;
  padding: 0;
  text-shadow: none;
  text-align: right;
  white-space: nowrap;
}

.allocation-pie-wrapper.square-pie {
  flex: 1 1 auto;
  width: 540px;
  height: 540px;
  max-width: 540px;
  max-height: 540px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.3rem;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: none;
  backdrop-filter: none;
}

.allocation-pie-wrapper.square-pie canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 500px;
  max-height: 500px;
}

@media (max-width: 1100px) {
  .allocation-container.vertical-layout {
    flex-direction: column-reverse;
    align-items: center;
  }
  .allocation-stats.vertical-list {
    flex: 0 0 auto;
    width: 100%;
    max-width: 620px;
  }
  .allocation-pie-wrapper.square-pie {
    width: 480px;
    height: 480px;
  }
}

@media (max-width: 650px) {
  .allocation-pie-wrapper.square-pie {
    width: 380px;
    height: 380px;
    padding: 1.1rem;
  }
  .allocation-list-vertical {
    max-height: 380px;
  }
}
.stocks-table {
  width: 100%;
  max-width: 960px; /* center like Allocation panels */
  margin: 0 auto; /* perfect centering */
  border-collapse: separate;
  border-spacing: 0 0; /* remove vertical gap between rows */
}

.stocks-table th,
.stocks-table td {
  font-weight: 400;
}

/* Center the Stocks header controls to the same width */
#stocks-section .table-header {
  max-width: 960px;
  margin: 0 auto 1.5rem;
}

#stocks-section .stocks-last-updated {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.72rem;
  margin-left: 0.35rem;
  margin-right: 0.35rem;
  white-space: nowrap;
}

#stocks-section .stocks-table thead th {
  position: relative;
}

.column-filter-toggle {
  margin-left: 6px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0 4px;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.column-filter-toggle .chev {
  font-size: 0.9rem;
}

.column-filter-toggle.active {
  color: #00c774;
}

.column-filter-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.column-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  max-height: 260px;
  overflow: auto;
  padding: 0.5rem;
  border-radius: 12px;
  background: rgba(15, 20, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  display: none;
  z-index: 20;
}

.column-filter-menu.open {
  display: block;
}

.column-filter-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-weight: 600;
  text-align: left;
}

.column-filter-option.active {
  background: rgba(0, 199, 116, 0.15);
  color: #00c774;
}

.column-filter-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Stocks: header row design to match screenshot */
#stocks-section .stocks-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--stocks-row-grad-start);
  border: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.35);
  border-radius: 0;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 10px 6px 12px;
  text-shadow: none;
}

/* Subtle hover for Stocks headers */
#stocks-section .stocks-table th.sortable:hover {
  color: rgba(255, 255, 255, 0.95);
}

/* Center the Deposits header controls to the same width */
#deposits-section .table-header {
  /* revert to default (no forced centering) */
  max-width: unset;
  margin: 0 0 1.5rem 0;
}

.stocks-table thead tr {
  display: grid;
  grid-template-columns: 33px 70px 94px 1.38fr 112px 81px 70px 136px 101px 115px 115px 90px; /* Shrunk Price Change column by 15% (160px -> 136px) */
  gap: 8px;
}

/* Deposits table header grid */
#deposits-section .stocks-table thead tr {
  display: grid;
  grid-template-columns: 70px 160px 140px 160px 140px 120px; /* revert to original widths */
  gap: 8px;
}

/* Prevent wrapping of the 'Price Change' column header text */
.stocks-table thead th:nth-child(8) {
  white-space: nowrap;
}
.stocks-table thead th {
  background: var(--stocks-row-grad-start);
  color: rgba(255, 255, 255, 0.7);
  padding: 10px 6px 12px;
  border: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.35);
  border-radius: 0;
  font-weight: 600;
  text-shadow: none;
}

#stocks-tbody tr {
  display: grid;
  grid-template-columns: 33px 70px 94px 1.38fr 112px 81px 70px 136px 101px 115px 115px 90px; /* Match 15% shrink for Price Change column in body */
  gap: 3px;
  /* Darker card background for clear breakdown contrast */
  /* Lightened ~15% (reduced alpha values for a brighter appearance) */
  /* Lightened further by ~20% (alphas * 0.8) */
  background: var(--stocks-row-grad-start);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 3px; /* further compact (~30% of 4px) */
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  min-height: unset;
  align-items: center;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

/* Deposits table rows styled like Stocks cards */
#deposits-tbody tr {
  display: grid;
  grid-template-columns: 70px 160px 140px 160px 140px 120px; /* revert to original widths */
  gap: 3px;
  /* Match lightened Stocks row gradient */
  /* Lightened ~20% (alphas *0.8) */
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.476), rgba(0, 0, 0, 0.34));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 3px; /* further compact */
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  min-height: unset;
  align-items: center;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

#deposits-tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.22);
  /* Lightened hover similar to Stocks */
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.503), rgba(0, 0, 0, 0.367));
}

#stocks-tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.22);
  /* Hover state also lightened proportionally */
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.503), rgba(0, 0, 0, 0.367));
}

#stocks-tbody td {
  background: transparent;
  color: #eee;
  padding: 0 3px; /* zero vertical padding */
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: none;
  line-height: 1.05; /* slightly tighter */
}

#deposits-tbody td {
  background: transparent;
  color: #eee;
  padding: 0 3px; /* zero vertical padding */
  display: flex;
  align-items: center;
  justify-content: space-between; /* revert alignment */
  text-align: left; /* revert alignment */
  border: none;
  line-height: 1.05;
}

/* Center Deposits header labels */
#deposits-section .stocks-table thead th {
  text-align: left; /* revert header label alignment */
}

#stocks-tbody td[data-field='number'] {
  justify-content: center;
  font-weight: 700;
  color: #9e9e9e;
}

#stocks-tbody td[data-field='symbol'],
#stocks-tbody td[data-field='company'] {
  font-weight: 600;
  color: #fff;
}

/* Center content in Symbol column */
#stocks-tbody td[data-field='symbol'] {
  justify-content: center !important;
  text-align: center;
}

#stocks-tbody td[data-field='allocation'],
#stocks-tbody td[data-field='weight'] {
  color: #00d9ff;
  font-weight: 700;
}

/* Center content in Weight column */
#stocks-tbody td[data-field='weight'] {
  justify-content: center;
  text-align: center;
}

#stocks-tbody td[data-field='share_price'],
#stocks-tbody td[data-field='price_change'] {
  font-weight: 600;
}

/* Align Price column slightly left */
#stocks-tbody td[data-field='share_price'] {
  justify-content: flex-start !important;
  text-align: left !important;
  padding-left: 6px;
  padding-right: 0;
}

/* Align Price Change column left (not centered) */
#stocks-tbody td[data-field='price_change'] {
  justify-content: flex-start !important;
  text-align: left !important;
  padding-left: 6px;
  padding-right: 0;
}

/* Align Price Change header label left */
.stocks-table thead th:nth-child(8) {
  text-align: left;
}

/* Align Price header label left */
.stocks-table thead th:nth-child(7) {
  text-align: left;
}

/* Align Shares column slightly left */
#stocks-tbody td[data-field='shares'] {
  display: flex;
  justify-content: flex-start !important;
  align-items: center !important;
  text-align: left !important;
  padding-left: 6px;
  padding-right: 0;
}

#stocks-tbody td[data-field='shares'] input {
  text-align: left !important;
}

/* Align Shares header label left */
.stocks-table thead th:nth-child(6) {
  text-align: left;
}

/* Deposits: align numeric and action columns */
#deposits-section .stocks-table thead th:nth-child(1),
#deposits-tbody td[data-field='count'] {
  justify-content: center;
  text-align: center;
  font-weight: 700;
  color: #9e9e9e;
}

#deposits-section .stocks-table thead th:nth-child(4),
#deposits-tbody td[data-field='amount'] {
  color: #00d9ff;
  font-weight: 700;
}

#deposits-tbody td.action-buttons {
  justify-content: flex-end; /* revert actions alignment */
  align-items: center;
  gap: 8px;
}

#stocks-tbody td[data-field='risk'] {
  font-weight: 700;
  white-space: nowrap; /* force single line */
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: flex-start;
  text-align: left;
}

#stocks-tbody td[data-field='risk'] .risk-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
}

#stocks-tbody td[data-field='risk'] .risk-dot--high {
  background: #ff5252;
}

#stocks-tbody td[data-field='risk'] .risk-dot--medium {
  background: #ffd166;
}

#stocks-tbody td[data-field='risk'] .risk-dot--safe {
  background: #5aa9ff;
}

#stocks-tbody td[data-field='risk'] .risk-dot--very-safe {
  background: #4ade80;
}

#stocks-tbody td.action-buttons {
  justify-content: flex-end; /* place buttons at end of row */
  align-items: center;
  gap: 8px;
  grid-column: 12; /* force actions cell to the final grid column */
}

.stocks-table .sort-icon {
  opacity: 0.6;
  margin-left: 6px;
}

.stocks-table th.sorted-asc .sort-icon::after {
  content: '↑';
  margin-left: 4px;
}
.stocks-table th.sorted-desc .sort-icon::after {
  content: '↓';
  margin-left: 4px;
}

/* Inputs/selects inside cards */
#stocks-tbody .editable-cell input,
#stocks-tbody .editable-cell select {
  width: 100%;
  background: #232323;
  color: #fff;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 6px 8px;
}

/* Price change colors already set inline; add default neutral */
.price-change-cell {
  color: #ccc;
}

/* Stocks table: light gray text for key columns */
#stocks-section td[data-field="symbol"],
#stocks-section td[data-field="company"],
#stocks-section td[data-field="shares"],
#stocks-section td[data-field="share_price"],
#stocks-section td[data-field="broker"],
#stocks-section td[data-field="sector"],
#stocks-section td[data-field="risk"] {
  color: #dcdcdc;
}

#stocks-section td[data-field="company"] {
  position: relative;
  max-width: 180px;
}

#stocks-section td[data-field="company"] .company-ellipsis {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.2em;
  max-height: 2.4em;
}

#stocks-section td[data-field="company"][data-tooltip] {
  cursor: help;
}

#stocks-section td[data-field="company"][data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 10px;
  top: 100%;
  margin-top: 8px;
  background: #ffffff;
  color: #111111;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.2;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 1000;
  white-space: nowrap;
  max-width: none;
}

#stocks-section td[data-field="company"][data-tooltip]::before {
  content: '';
  position: absolute;
  left: 24px;
  top: calc(100% + 2px);
  border: 6px solid transparent;
  border-bottom-color: #ffffff;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 1001;
}

#stocks-section td[data-field="company"][data-tooltip]:hover::after,
#stocks-section td[data-field="company"][data-tooltip]:hover::before {
  opacity: 1;
  transform: translateY(0) scale(1);
}

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

:root {
  --stocks-row-grad-start: rgba(20, 26, 38, 0.98);
  --stocks-row-grad-end: rgba(14, 18, 28, 0.98);
}

body {
  font-family: 'Manrope', 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  background: var(--stocks-row-grad-start);
  padding-top: 80px;
}

/* === Login Page === */
.login-body {
  padding-top: 0; /* no navbar spacing on login */
}

.login-container {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-card {
  width: 100%;
  max-width: 520px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(22px);
  border-radius: 25px;
  padding: 1.6rem 1.6rem 1.2rem 1.6rem;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 10px 25px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transform: perspective(1000px) rotateX(2deg);
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.login-card:hover {
  transform: perspective(1000px) rotateX(0deg) translateY(-4px) scale(1.01);
}

.login-brand {
  position: relative;
  text-align: center;
  margin-bottom: 1rem;
}

.brand-logo-wrap {
  width: 120px;
  height: 120px;
  margin: 0 auto 0.6rem auto;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow:
    0 14px 36px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(16px);
}

.brand-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.45));
}

.brand-glow {
  position: absolute;
  inset: -2px;
  border-radius: 22px;
  background: linear-gradient(45deg, var(--stocks-row-grad-start), var(--stocks-row-grad-end));
  opacity: 0.15;
  filter: blur(18px);
  pointer-events: none;
}

.brand-title {
  color: #ffffff;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow:
    2px 2px 4px rgba(0, 0, 0, 0.5),
    0 0 18px rgba(255, 255, 255, 0.35);
}

.brand-sub {
  margin-top: 0.25rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  font-size: 0.95rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.input-group {
  text-align: left;
}

.input-label {
  display: block;
  margin-bottom: 0.35rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.2px;
}

.password-wrapper {
  position: relative;
}

.login-input {
  width: 100%;
  background: #232323;
  color: #fff;
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  padding: 12px 42px 12px 12px;
  font-size: 0.95rem;
  outline: none;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.login-input:focus {
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.35);
}

.login-input::placeholder { color: rgba(255,255,255,0.6); }

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

.shake {
  animation: shakeX 0.35s ease;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
}

.remember-me {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  color: rgba(255, 255, 255, 0.85);
  user-select: none;
}

.remember-me input {
  accent-color: #ffffff;
}

.forgot-link {
  color: #00d9ff;
  text-decoration: none;
  font-weight: 700;
}

.forgot-link:hover {
  text-decoration: underline;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  text-decoration: none;
}

.login-btn.primary {
  background: linear-gradient(135deg, var(--stocks-row-grad-start) 0%, var(--stocks-row-grad-end) 100%);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.login-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.login-btn.ghost {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.login-btn.ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

.login-separator {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.8rem 0 0.4rem 0;
}

.sep-line {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
}

.sep-text {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  font-size: 0.8rem;
}

.login-actions {
  display: grid;
  grid-template-columns: 1fr;
}

.login-footer {
  margin-top: 0.9rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
}

/* Navbar Styles */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(20, 26, 38, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1000;
  padding: 1rem 0;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nav-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  align-items: center;
}

.stat-item {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

#total-balance {
  color: #00d9ff;
  font-size: 1.7rem;
  font-weight: 800;
  text-shadow:
    0 0 15px rgba(0, 217, 255, 0.5),
    2px 2px 4px rgba(0, 0, 0, 0.4);
}

#total-profit {
  color: #00ff88;
  font-size: 1.7rem;
  font-weight: 800;
  text-shadow:
    0 0 15px rgba(0, 255, 136, 0.4),
    2px 2px 4px rgba(0, 0, 0, 0.4);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.nav-menu li a {
  color: #dcdcdc;
  text-decoration: none;
  font-size: clamp(0.72rem, 0.9vw, 0.92rem);
  transition: all 0.3s ease;
  padding: 0.35rem 0.6rem;
  border-radius: 5px;
  white-space: nowrap;
}

.nav-menu li a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.nav-menu li a.active {
  background: rgba(255, 255, 255, 0.3);
}

.nav-settings {
  margin-left: auto;
  position: relative;
}

.settings-cog-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.settings-cog-btn svg {
  width: 20px;
  height: 20px;
  fill: #ffffff;
}

.settings-menu {
  position: absolute;
  top: 48px;
  right: 0;
  width: 280px;
  padding: 0.85rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #1d2634, #151c28);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  display: none;
  flex-direction: column;
  gap: 0.7rem;
  z-index: 1200;
}

.settings-menu.is-open {
  display: flex;
}

.settings-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #f5f5ff;
  font-weight: 600;
  cursor: pointer;
}

.settings-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.3rem 0.2rem;
  color: rgba(255, 255, 255, 0.9);
}

.settings-select {
  background: rgba(0, 0, 0, 0.3);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
}

.settings-chip-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.settings-chip {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  padding: 0.35rem 0.5rem;
  font-weight: 600;
  cursor: pointer;
}

.settings-logout-btn {
  border: none;
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, rgba(116, 75, 196, 0.95), rgba(102, 126, 234, 0.9));
  cursor: pointer;
}

/* ===== Leaderboard ===== */
#leaderboard-section {
  padding-top: 0.75rem;
}

.leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  color: #ffffff;
}

.leaderboard-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #f1f1ff;
}

.leaderboard-loaded {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  color: #e6e6ff;
}

.leaderboard-top-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.85rem;
}

.leaderboard-card {
  background: rgba(15, 18, 32, 0.35);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.7rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.leaderboard-card.gold { border-color: rgba(255, 209, 102, 0.5); }
.leaderboard-card.silver { border-color: rgba(200, 210, 230, 0.6); }
.leaderboard-card.bronze { border-color: rgba(255, 177, 102, 0.5); }

.leaderboard-tier {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffd166;
}

.leaderboard-card.silver .leaderboard-tier { color: #cbd3e3; }
.leaderboard-card.bronze .leaderboard-tier { color: #ffb066; }

.leaderboard-card-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.leaderboard-card-meta {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
}

.leaderboard-popular {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.25), rgba(20, 30, 70, 0.35));
  border: 1px solid rgba(0, 217, 255, 0.3);
  color: #e8faff;
  margin-bottom: 0.8rem;
}

.leaderboard-popular-tag {
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  color: #7fe6ff;
  font-weight: 700;
}

.leaderboard-popular-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.leaderboard-popular-meta {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
}

.leaderboard-table {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 0.4rem;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4);
}

.leaderboard-table table {
  width: 100%;
  border-collapse: collapse;
  color: #ffffff;
  font-size: 0.75rem;
}

.leaderboard-table thead th {
  text-align: left;
  padding: 0.6rem 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

.leaderboard-table tbody td {
  padding: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.leaderboard-rank {
  font-weight: 700;
  color: #ffd166;
}

.leaderboard-like {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

@media (max-width: 900px) {
  .leaderboard-top-cards {
    grid-template-columns: 1fr;
  }
  .leaderboard-popular {
    flex-direction: column;
    align-items: flex-start;
  }
}

.container {
  text-align: center;
  color: white;
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.section {
  display: none;
  min-height: calc(100vh - 140px);
}

.section.active {
  display: block;
}

#dashboard-section.active {
  display: block;
}

#dividends-section.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#stocks-section,
#deposits-section,
#dividends-section {
  padding-top: 0;
  margin-top: -2rem;
}

h1 {
  font-size: 3rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 2rem;
}

p {
  font-size: 1.5rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  width: 100%;
  align-items: start;
}

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

/* Chart Styles - WOW 3D Effect */
.chart-container {
  background: rgba(20, 26, 38, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 25px;
  padding: 1.5rem;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 10px 25px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 300px;
  height: 380px;
  transform: none;
  transition: none;
  position: relative;
  z-index: 100; /* keep pie chart above nearby panels/popups */
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
}

/* === Dashboard Metrics Overlay (top-right of Balance pie chart) === */
.dashboard-metrics-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem 0.9rem 1rem;
  background: rgba(20, 26, 38, 0.95);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 18px;
  box-shadow:
    0 10px 28px rgba(0,0,0,0.45),
    0 4px 12px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -1px 0 rgba(0,0,0,0.2);
  min-width: 220px;
  z-index: 120;
}

.dashboard-metrics-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(102,126,234,0.35), rgba(118,75,162,0.35));
  mix-blend-mode: overlay;
  opacity: 0.35;
  pointer-events: none;
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.6rem 0.4rem 0.6rem;
  background: rgba(20, 26, 38, 0.95);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
}

.metric-row::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0.12), rgba(255,255,255,0));
  opacity: 0;
  transition: opacity 0.35s ease;
}

.metric-row:hover::after {
  opacity: 1;
}

.metric-label {
  color: rgba(220, 220, 220, 0.9);
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  flex: 1;
}

.metric-value {
  font-size: 0.75rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  color: #dcdcdc;
  text-shadow:
    0 0 10px rgba(255,255,255,0.25),
    1px 1px 2px rgba(0,0,0,0.6);
  white-space: nowrap;
}

.metric-value.positive { color: #00ff88; text-shadow: 0 0 10px rgba(0,255,136,0.45); }
.metric-value.warning { color: #ffc107; text-shadow: 0 0 10px rgba(255,193,7,0.4); }
.metric-value.accent { color: #00d9ff; text-shadow: 0 0 10px rgba(0,217,255,0.4); }

@media (max-width: 900px) {
  .dashboard-metrics-overlay {
    position: static;
    margin-top: 0.8rem;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.8rem 0.9rem;
  }
  .metric-row { flex: 1 1 calc(50% - 0.5rem); }
}

.chart-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--stocks-row-grad-start), var(--stocks-row-grad-end));
  border-radius: 25px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Wide Panel Container */
.wide-panel-container {
  background: rgba(20, 26, 38, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 25px;
  padding: 1.5rem;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 10px 25px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transform: none;
  transition: none;
  position: relative;
  margin-top: 2rem;
  width: calc(100% + 10px);
  margin-left: -5px;
  min-height: 280px;
}

.wide-panel-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--stocks-row-grad-start), var(--stocks-row-grad-end));
  border-radius: 25px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.wide-panel-container:hover::before {
  opacity: 0;
}

.wide-panel-container:hover {
  transform: none;
  box-shadow: none;
}

.wide-panel-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* fit 5 zones on one row */
  gap: 1mm; /* ultra-tight spacing between the 5 zones */
  width: 100%;
  height: 100%;
}

.panel-zone {
  background: rgba(20, 26, 38, 0.95);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transition: none;
}

/* Metrics panel adjustments */
.metrics-panel-zone {
  padding: calc(0.85rem + 5mm) 0.7rem 0.9rem 0.7rem; /* add ~5mm top spacing above title */
  display: flex;
}

.metrics-panel {
  display: flex;
  flex-direction: column;
  gap: 0.2rem; /* halve spacing between metric rows */
  width: 100%;
}

.metrics-panel .panel-zone-title {
  margin-bottom: 0.55rem;
}

@media (max-width: 1350px) {
  .wide-panel-grid {
    grid-template-columns: repeat(2, 1fr); /* responsive fallback */
    row-gap: 1.2rem;
  }
}

/* Shrink the Deposits tab panel by ~20% in both width and height */
#deposits-section .panel-zone {
  transform: scale(0.9);
  transform-origin: top center;
}

.panel-zone:hover {
  background: rgba(20, 26, 38, 0.95);
  transform: none;
  box-shadow: none;
}

.panel-zone-tall {
  height: 230px;
}

/* Deposits Breakdown */
.panel-zone-title {
  color: #dcdcdc;
  font-size: 1.1rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 1rem;
  text-align: center;
}

.deposits-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0; /* remove spacing between allocation items */
  width: 100%;
  padding: 0.5rem;
  height: 100%;
}

/* Narrow + centered version inside Deposits tab */
#deposits-section .deposits-breakdown {
  width: 50%; /* previous width (will be overridden below) */
  margin: 0.5rem auto 1rem auto;
}

#deposits-section .deposits-breakdown .breakdown-item {
  justify-content: space-between; /* restore default alignment */
  text-align: left; /* restore default text alignment */
  gap: 2px;
}

#deposits-section .deposits-breakdown .breakdown-label,
#deposits-section .deposits-breakdown .breakdown-value,
#deposits-section .deposits-breakdown .breakdown-value-white {
  display: inline-block;
  text-align: left; /* restore left alignment */
}

/* === Deposits Section: Full-width Money Invested panel === */
/* Override earlier shrink & width constraints to match table / total panel width */
#deposits-section .panel-zone {
  transform: none !important; /* remove scale(0.9) shrink */
  width: 100%;
  max-width: 768px; /* align with deposits table max width (reduced by 20%) */
  margin-left: auto;
  margin-right: auto;
}
#deposits-section .deposits-breakdown {
  width: 100% !important; /* fill full available width inside panel */
  margin: 0.5rem 0 1rem 0 !important; /* remove auto centering gaps */
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
#deposits-section .deposits-breakdown .breakdown-item {
  padding-left: 0.8rem;
  padding-right: 0.8rem;
}

/* Embedded Total Deposits row: match panel background and increase font size */
#deposits-section .deposits-breakdown .breakdown-item.total-deposits-row {
  /* Use same background treatment as panel */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border-color: rgba(255, 255, 255, 0.1);
}
#deposits-section .deposits-breakdown .breakdown-item.total-deposits-row .breakdown-label {
  font-size: 1.1rem; /* +2 steps over 0.9rem */
  font-weight: 400; /* regular, not bold */
}
#deposits-section .deposits-breakdown .breakdown-item.total-deposits-row .breakdown-value,
#deposits-section .deposits-breakdown .breakdown-item.total-deposits-row .breakdown-value-white {
  font-size: 1.2rem; /* +2 steps over 1.0rem */
  font-weight: 700;
}

/* Deposits table: amount values should be white */
#deposits-section td[data-field="amount"] {
  color: #ffffff;
}

/* Deposits table: header 'Account' in white (override any theme color) */
#deposits-section table.stocks-table thead tr th[data-column="account"] {
  color: #ffffff !important;
}

/* Deposits table: align Account, Month, Amount text to the left (not centered) */
#deposits-section td[data-field="account"],
#deposits-section td[data-field="amount"],
#deposits-section td[data-field="currency"] {
  text-align: left;
}

/* Align Total Deposits panel and Deposits table to reduced width */
#deposits-section .deposits-total,
#deposits-section .stocks-table {
  max-width: 768px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Increase font sizes for the 5 rows in Deposits tab */
#deposits-section .deposits-breakdown .breakdown-label {
  font-size: 0.9rem; /* was 0.7rem */
}

#deposits-section .deposits-breakdown .breakdown-value,
#deposits-section .deposits-breakdown .breakdown-value-white {
  font-size: 1rem; /* was 0.8rem */
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(20, 26, 38, 0.95);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  transition: none;
  gap: 2px;
  min-height: 36px;
}

/* Balance panel: increase row height by ~15% */
.wide-panel-grid .panel-zone:first-child .breakdown-item {
  min-height: 41px; /* 36px * 1.15 ≈ 41.4px */
  padding: 0.368rem 2.5mm; /* horizontal padding ~2.5mm */
}

/* Money invested panel: increase each row height by ~1.4mm */
.wide-panel-grid .panel-zone:nth-child(2) .breakdown-item {
  min-height: calc(36px + 1.4mm);
  padding-top: calc(0.32rem + 0.18mm);
  padding-bottom: calc(0.32rem + 0.18mm);
}

/* Balance panel: reduce left/right gutters to ~1mm */
.wide-panel-grid .panel-zone:first-child {
  padding-left: 2.5mm;
  padding-right: 2.5mm;
}
.wide-panel-grid .panel-zone:first-child .deposits-breakdown {
  padding-left: 0;
  padding-right: 0;
}

/* Money invested panel (2nd): match ~2.5mm gutters and row padding */
.wide-panel-grid .panel-zone:nth-child(2) {
  padding-left: 2.5mm;
  padding-right: 2.5mm;
}
.wide-panel-grid .panel-zone:nth-child(2) .deposits-breakdown {
  padding-left: 0;
  padding-right: 0;
}
.wide-panel-grid .panel-zone:nth-child(2) .breakdown-item {
  padding-left: 2.5mm;
  padding-right: 2.5mm;
}

/* Profit panel (3rd): match ~2.5mm gutters and row padding */
.wide-panel-grid .panel-zone:nth-child(3) {
  padding-left: 2.5mm;
  padding-right: 2.5mm;
}
.wide-panel-grid .panel-zone:nth-child(3) .profit-box {
  padding-left: 2.5mm;
  padding-right: 2.5mm;
}

/* Total return panel (4th): match ~2.5mm gutters and row padding */
.wide-panel-grid .panel-zone:nth-child(4) {
  padding-left: 2.5mm;
  padding-right: 2.5mm;
}
.wide-panel-grid .panel-zone:nth-child(4) .profit-box {
  padding-left: 2.5mm;
  padding-right: 2.5mm;
}

/* Profit panel: increase each row height by ~1.4mm */
.wide-panel-grid .panel-zone:nth-child(3) .profit-box {
  min-height: calc(36px + 1.4mm);
  padding-top: calc(0.2rem + 0.18mm);
  padding-bottom: calc(0.2rem + 0.18mm);
}

/* Total return panel: increase each row height by ~1.4mm */
.wide-panel-grid .panel-zone:nth-child(4) .profit-box {
  min-height: calc(36px + 1.4mm);
  padding-top: calc(0.2rem + 0.18mm);
  padding-bottom: calc(0.2rem + 0.18mm);
}

/* === Deposits Page: Reduce Money Invested panel height (only duplicate panel) === */
/* Apply ~15% vertical reduction while preserving font sizes/content scale */
#deposits-section .panel-zone .deposits-breakdown .breakdown-item {
  min-height: 31px; /* 36px * 0.85 ≈ 30.6px */
  padding-top: 0.27rem; /* 0.32rem * 0.85 ≈ 0.272rem */
  padding-bottom: 0.27rem;
}
/* Reduce panel vertical padding itself by 15% (keep horizontal) */
#deposits-section .panel-zone {
  padding-top: 0.85rem; /* was 1rem */
  padding-bottom: 0.85rem;
  /* Width reduction by ~20% while keeping content scale */
  max-width: 768px; /* 960px * 0.8 */
  width: 100%;
}

/* === Profit Split Grid === */
.profit-split-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr; /* two columns */
  gap: 0.25rem; /* tighter spacing between columns */
  width: 100%;
}

.profit-col {
  display: flex;
  flex-direction: column;
  gap: 0; /* no space between rows, matches Balance/Money Invested */
}

/* Combined column: label + value on one row */
.profit-col.combined .profit-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}

.profit-col.combined .profit-label {
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #dcdcdc;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
  font-size: 0.7rem; /* align with previous label size */
}

.profit-col.combined .profit-value {
  color: #00d9ff;
  font-weight: 400;
  text-shadow:
    0 0 10px rgba(0, 217, 255, 0.4),
    1px 1px 2px rgba(0, 0, 0, 0.5);
  font-size: 0.8rem; /* match previous profit value emphasis */
}

.profit-box {
  background: rgba(20, 26, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #dcdcdc;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  transition: none;
  line-height: 1.03;
}

.profit-box:hover {
  background: rgba(20, 26, 38, 0.95);
  box-shadow: none;
  transform: none;
}

.profit-col.brokers .profit-box.profit-label {
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #dcdcdc;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
  font-size: 0.7rem; /* align with breakdown-label */
}

.profit-col.profits .profit-box {
  color: #00d9ff;
  font-weight: 400;
  text-shadow:
    0 0 10px rgba(0, 217, 255, 0.4),
    1px 1px 2px rgba(0, 0, 0, 0.5);
  font-size: 0.8rem; /* match breakdown-value emphasis */
}

.profit-col.returns .profit-box {
  color: #00ff88;
  font-weight: 400;
  text-shadow:
    0 0 10px rgba(0, 255, 136, 0.4),
    1px 1px 2px rgba(0, 0, 0, 0.6);
  font-size: 0.8rem; /* same emphasis as profit values */
  justify-content: space-between;
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}

.profit-col.returns .profit-label {
  color: #dcdcdc;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
  font-size: 0.7rem;
}

.profit-col.returns .profit-value {
  color: #00ff88;
  font-weight: 400;
  text-shadow:
    0 0 10px rgba(0, 255, 136, 0.4),
    1px 1px 2px rgba(0, 0, 0, 0.6);
  font-size: 0.8rem;
}

/* Title above the returns column */
.profit-column-title {
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  margin: 0.1rem 0 0.2rem 0; /* tight spacing */
  text-align: center;
}

.breakdown-item-compact {
  gap: 0px;
}

.breakdown-item:hover {
  background: rgba(20, 26, 38, 0.95);
  transform: none;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.08);
}

.breakdown-label {
  color: rgba(220, 220, 220, 0.9);
  font-size: 0.7rem;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.breakdown-value {
  color: #00d9ff;
  font-size: 0.8rem;
  font-weight: 400;
  text-shadow:
    0 0 10px rgba(0, 217, 255, 0.4),
    1px 1px 2px rgba(0, 0, 0, 0.3);
  text-align: right;
  white-space: nowrap;
}

.breakdown-value-white {
  color: #dcdcdc !important;
  font-weight: 400;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
}

.breakdown-value-profit {
  text-align: right;
  white-space: nowrap;
  display: inline-block;
  width: 140px;
  font-variant-numeric: tabular-nums;
}

.chart-container:hover {
  transform: none;
  box-shadow: none;
}

.chart-container:hover::before {
  opacity: 0;
}

.chart-container h2 {
  color: #dcdcdc;
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 700;
  text-shadow:
    2px 2px 4px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(255, 255, 255, 0.3);
  letter-spacing: 0.5px;
}

#balance-pie-chart {
  max-width: 250px;
  max-height: 250px;
  margin: 0 auto;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.4));
  position: relative;
  z-index: 101; /* ensure canvas renders above decorations */
}

/* Performance Chart Styles */
.performance-chart-container {
  background: rgba(20, 26, 38, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 25px;
  padding: 1.5rem;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 10px 25px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: none;
  transition: none;
  position: relative;
  margin-top: 1.5rem;
  height: 380px;
  display: flex;
  flex-direction: column;
}

.performance-chart-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--stocks-row-grad-start), var(--stocks-row-grad-end));
  border-radius: 25px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.performance-chart-container:hover {
  transform: none;
  box-shadow: none;
}

.performance-chart-container:hover::before {
  opacity: 0;
}

.chart-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  gap: 0.75rem;
  flex-shrink: 0;
}

.chart-header h2 {
  color: #dcdcdc;
  font-size: 1.3rem;
  font-weight: 700;
  text-shadow:
    2px 2px 4px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(255, 255, 255, 0.3);
  letter-spacing: 0.5px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.performance-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
  border: 2px solid;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  min-width: 100px;
  justify-content: center;
}

.performance-badge.positive {
  background: rgba(240, 235, 255, 0.95);
  border-color: rgba(0, 255, 136, 0.6);
  color: #00ff88;
  text-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.performance-badge.negative {
  background: rgba(240, 235, 255, 0.95);
  border-color: rgba(255, 107, 107, 0.6);
  color: #d32f2f;
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

.performance-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.time-range-selector {
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.4rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
}

.time-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
  min-width: 40px;
}

.time-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.time-btn.active {
  background: linear-gradient(135deg, var(--stocks-row-grad-start) 0%, var(--stocks-row-grad-end) 100%);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
  transform: translateY(-2px);
}

.chart-legend {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-checkbox {
  cursor: pointer;
  transition: opacity 0.3s ease;
  user-select: none;
}

.legend-checkbox:hover {
  opacity: 0.8;
}

.legend-toggle {
  cursor: pointer;
  width: 14px;
  height: 14px;
  accent-color: white;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s ease;
}

.legend-checkbox:has(.legend-toggle:not(:checked)) .legend-color {
  opacity: 0.3;
}

.legend-checkbox:has(.legend-toggle:not(:checked)) .legend-label {
  opacity: 0.5;
}

.legend-label {
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease;
}

#performance-chart {
  width: 100%;
  flex: 1;
  min-height: 0;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

/* Table Header Styles */
.table-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
  gap: 8px;
  align-items: center;
}

.add-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.refresh-btn {
  background: rgba(138, 43, 226, 0.15);
  border: 1.5px solid rgba(138, 43, 226, 0.3);
  color: #9b59b6;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

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

.refresh-btn:hover {
  background: rgba(138, 43, 226, 0.25);
  box-shadow: 0 0 12px rgba(138, 43, 226, 0.3);
  border-color: rgba(138, 43, 226, 0.5);
}

.refresh-btn:active svg {
  animation: spin 0.6s ease-in-out;
}

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

.export-btn {
  background: rgba(0, 217, 255, 0.15);
  border: 1.5px solid rgba(0, 217, 255, 0.3);
  color: #00d9ff;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

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

.export-btn:hover {
  background: rgba(0, 217, 255, 0.25);
  box-shadow: 0 0 12px rgba(0, 217, 255, 0.3);
  border-color: rgba(0, 217, 255, 0.5);
}

/* Floating Add Button */
.floating-add-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--stocks-row-grad-start) 0%, var(--stocks-row-grad-end) 100%);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 999;
  opacity: 0;
}

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

.floating-add-btn:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.floating-add-btn:active {
  transform: scale(0.95) rotate(90deg);
}

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

/* Table Styles */
table thead tr {
  position: sticky;
  top: 0;
  z-index: 6;
  background: inherit;
}

table thead th {
  position: sticky;
  top: 0;
  z-index: 7;
  background: inherit;
}

.stocks-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.stocks-table thead {
  background: var(--stocks-row-grad-start);
}

.stocks-table th {
  padding: 0.5rem;
  text-align: left;
  font-weight: bold;
  color: white;
  font-size: 0.8rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.stocks-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.stocks-table th.sortable:hover {
  background: var(--stocks-row-grad-start);
  color: #64ffda;
}

.sort-icon {
  font-size: 0.7rem;
  opacity: 0.5;
  margin-left: 0.2rem;
  transition: opacity 0.2s ease;
}

.stocks-table th.sortable:hover .sort-icon {
  opacity: 1;
}

.stocks-table th.sorted-asc .sort-icon::after {
  content: ' ↑';
  opacity: 1;
  color: #64ffda;
}

.stocks-table th.sorted-desc .sort-icon::after {
  content: ' ↓';
  opacity: 1;
  color: #64ffda;
}

.stocks-table td {
  padding: 0.5rem;
  text-align: left;
  color: white;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  font-weight: 400 !important;
}

.stocks-table tbody td,
.stocks-table tbody td * ,
.stocks-table input,
.stocks-table select {
  font-weight: 400 !important;
}

.stocks-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.15);
}

.stocks-table input {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem;
  width: 100%;
  font-size: 0.75rem;
  border-radius: 3px;
}

.stocks-table input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.stocks-table select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem;
  width: 100%;
  font-size: 0.75rem;
  border-radius: 3px;
  cursor: pointer;
}

/* Match table input colors to Stocks table */
#dividends-table input,
#dividends-table select,
#dividends-monthly-table input,
#dividends-monthly-table select,
#stocks-gains-table input,
#stocks-gains-table select,
#withdrawals-table input,
#withdrawals-table select {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem;
  width: 100%;
  font-size: 0.75rem;
  border-radius: 3px;
}

#dividends-table input:focus,
#dividends-table select:focus,
#dividends-monthly-table input:focus,
#dividends-monthly-table select:focus,
#stocks-gains-table input:focus,
#stocks-gains-table select:focus,
#withdrawals-table input:focus,
#withdrawals-table select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.sector-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 6px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.sector-option {
  padding: 8px 10px;
  cursor: pointer;
  color: white;
  font-size: 0.8rem;
}

.sector-option.sector {
  font-weight: 700;
}

.sector-option.subsector {
  font-weight: 400;
  padding-left: 18px;
  opacity: 0.95;
}

.stocks-table select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.stocks-table select option {
  background: var(--stocks-row-grad-start);
  color: white;
  padding: 0.5rem;
}

.deposits-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto 1rem auto;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  width: 100%;
}

/* Match width with Deposits table container */
#deposits-section .deposits-total,
#deposits-section .stocks-table {
  max-width: 768px;
}

/* Center both elements to align widths visually */
#deposits-section .deposits-total,
#deposits-section .stocks-table {
  margin-left: auto;
  margin-right: auto;
}

.deposits-total span:first-child {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.deposits-total span:last-child {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: none;
}

.action-buttons {
  display: flex;
  gap: 0.3rem;
  justify-content: center;
}

.action-menu {
  position: relative;
  display: inline-flex;
}

.action-menu-toggle {
  border: none;
  background: transparent;
  border-radius: 10px;
  width: 34px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.action-menu-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.action-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 160px;
  padding: 0.5rem;
  border-radius: 14px;
  background: radial-gradient(120% 140% at 20% -10%, rgba(0, 199, 116, 0.18), rgba(10, 14, 24, 0.95)),
    linear-gradient(160deg, rgba(24, 28, 42, 0.98), rgba(10, 14, 24, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: none;
  z-index: 25;
  backdrop-filter: blur(12px);
}

.action-menu-panel.open {
  display: grid;
  gap: 0.35rem;
}

.action-menu-item {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.92);
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.action-menu-item:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.action-menu-item.delete-btn:hover {
  background: rgba(244, 67, 54, 0.15);
  color: #ff8b84;
}

.edit-btn,
.delete-btn {
  padding: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  border-radius: 3px;
  cursor: pointer;
  color: white;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.edit-btn svg,
.delete-btn svg {
  display: block;
}

.edit-btn:hover {
  background: rgba(76, 175, 80, 0.2);
  border-color: rgba(76, 175, 80, 0.5);
}

.delete-btn:hover {
  background: rgba(244, 67, 54, 0.2);
  border-color: rgba(244, 67, 54, 0.5);
}

/* Risk Info Icon & Tooltip */
.risk-header {
  position: relative;
}

.info-icon {
  cursor: help;
  display: inline-block;
  margin-left: 0.3rem;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  vertical-align: middle;
}

.info-icon:hover {
  color: white;
}

.info-icon svg {
  display: inline-block;
  vertical-align: middle;
}

.tooltip {
  display: none;
  position: fixed;
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 1rem;
  min-width: 190px;
  z-index: 10000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  pointer-events: none;
}

.tooltip.show {
  display: block;
}

.tooltip-title {
  font-weight: bold;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.5rem;
}

.tooltip-item {
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
}

.risk-indicator {
  margin-right: 0.5rem;
  font-size: 1rem;
}

/* Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 999999;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

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

.modal-content {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
  text-align: center;
}

.modal-content.account-modal {
  background: radial-gradient(140% 180% at 20% -20%, rgba(0, 199, 116, 0.2), rgba(12, 16, 28, 0.98)),
    linear-gradient(160deg, rgba(20, 24, 38, 0.98), rgba(8, 12, 20, 0.98));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.modal-content.account-modal .modal-title,
.modal-content.account-modal .modal-message {
  color: rgba(255, 255, 255, 0.92);
}

.modal-content.account-modal.is-warning {
  background: radial-gradient(140% 180% at 20% -20%, rgba(255, 193, 7, 0.2), rgba(12, 16, 28, 0.98)),
    linear-gradient(160deg, rgba(20, 24, 38, 0.98), rgba(8, 12, 20, 0.98));
}

.modal-content.account-modal.is-success {
  background: radial-gradient(140% 180% at 20% -20%, rgba(0, 199, 116, 0.28), rgba(12, 16, 28, 0.98)),
    linear-gradient(160deg, rgba(20, 24, 38, 0.98), rgba(8, 12, 20, 0.98));
}

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

.modal-icon {
  margin-bottom: 1.5rem;
}

.modal-title {
  color: #333;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.modal-message {
  color: #666;
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 2rem;
}

.modal-message strong {
  color: #333;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.modal-btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-btn-cancel {
  background: rgba(0, 0, 0, 0.05);
  color: #666;
}

.modal-btn-cancel:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.modal-btn-confirm {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  color: white;
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.modal-btn-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}

.modal-content.account-modal .modal-btn-confirm {
  background: linear-gradient(135deg, #6a7cff, #8d6bff);
  box-shadow: 0 6px 18px rgba(106, 124, 255, 0.35);
}

.modal-content.account-modal.is-warning .modal-btn-confirm {
  background: linear-gradient(135deg, #ffb020, #ff8a00);
  box-shadow: 0 6px 18px rgba(255, 176, 32, 0.35);
}

.modal-content.account-modal.is-success .modal-btn-confirm {
  background: linear-gradient(135deg, #00c774, #00a85f);
  box-shadow: 0 6px 18px rgba(0, 199, 116, 0.35);
}

/* Admin Section Styles */
/* ===== Admin WOW Redesign ===== */
.admin-hero {
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 22px;
  padding: 1rem 1.25rem;
  box-shadow: 0 16px 42px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.28);
  margin: 0 auto 1.5rem auto;
  max-width: 980px;
}
.admin-title {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
}
.admin-subtitle {
  margin-top: 0.25rem;
  color: rgba(255,255,255,0.85);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.admin-panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  padding: 0.85rem 0.8rem 0.9rem 0.8rem;
}

.admin-table-panel {
  grid-column: 1 / -1;
}

/* Make Admin snapshots header sticky during scroll */
.admin-table-panel .table-container {
  max-height: 360px; /* scroll area height */
  overflow: auto;
  border-radius: 12px;
}
.admin-table-panel .data-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table-panel .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  backdrop-filter: blur(10px);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.2);
}
.admin-table-panel .data-table th,
.admin-table-panel .data-table td {
  padding: 0.5rem;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  font-size: 0.8rem;
}

.admin-actions,
.admin-danger-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.admin-danger-actions { margin-top: 0.5rem; }

.admin-range {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
}
.admin-label { color: rgba(255,255,255,0.9); font-size: 0.8rem; }
.admin-input {
  background: #232323;
  color: #fff;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 120px;
}

/* ===== Admin Dashboard (Screenshot Layout) ===== */
#admin-section .admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

#admin-section .admin-sidebar {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 1rem 0.85rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

#admin-section .admin-sidebar-header {
  padding: 0.25rem 0.5rem 0.4rem 0.5rem;
}

#admin-section .admin-sidebar-title {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.3px;
  color: #e6e9ff;
}

#admin-section .admin-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#admin-section .admin-side-item {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  text-align: left;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

#admin-section .admin-side-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

#admin-section .admin-side-item.active {
  background: linear-gradient(135deg, rgba(0, 217, 255, 0.25), rgba(102, 126, 234, 0.35));
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 16px rgba(0, 217, 255, 0.2);
}

#admin-section .admin-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

#admin-section .admin-hero-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

#admin-section .admin-hero-card h2 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: #ffffff;
}

#admin-section .admin-hero-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

#admin-section .admin-pill-row {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

#admin-section .admin-pill {
  background: rgba(0, 217, 140, 0.15);
  color: #68ffb7;
  border: 1px solid rgba(104, 255, 183, 0.35);
  padding: 0.45rem 0.85rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.85rem;
}

#admin-section .admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 0.8rem;
}

#admin-section .admin-kpi-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

#admin-section .admin-kpi-label {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
}

#admin-section .admin-kpi-value {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
}

#admin-section .admin-kpi-delta {
  font-size: 0.7rem;
  font-weight: 600;
}

#admin-section .admin-kpi-delta.positive {
  color: #7dffb6;
}

#admin-section .admin-kpi-delta.negative {
  color: #ff8b8b;
}

#admin-section .admin-charts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 0.9rem;
}

#admin-section .admin-chart-card {
  background: rgba(12, 16, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 0.85rem;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

#admin-section .admin-chart-card--wide {
  grid-column: span 1;
}

#admin-section .admin-chart-header {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  font-weight: 600;
}

#admin-section .admin-chart-body {
  flex: 1;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.8rem;
}

#admin-section .admin-chart-body.muted {
  border-style: dashed;
}

#admin-section .admin-chart-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(102, 126, 234, 0.08), rgba(0, 217, 255, 0.06));
  border-radius: 10px;
}

#admin-section .admin-view {
  display: none;
}

#admin-section .admin-view.active {
  display: block;
}

#admin-section .admin-users-summary {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

#admin-section .admin-summary-chip {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cfefff;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

#admin-section .admin-users-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

#admin-section .admin-info-card {
  background: rgba(12, 16, 30, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  color: rgba(255, 255, 255, 0.75);
}

#admin-section .admin-info-card h4 {
  margin: 0 0 0.35rem 0;
  color: #ffffff;
  font-size: 0.85rem;
}

#admin-section .admin-info-card p {
  margin: 0;
  font-size: 0.78rem;
}

#admin-section .admin-users-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

#admin-section .admin-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

#admin-section .admin-filter label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

#admin-section .admin-filter input,
#admin-section .admin-filter select {
  background: rgba(10, 14, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  font-size: 0.8rem;
}

#admin-section .admin-users-table {
  background: rgba(12, 16, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
}

#admin-section .admin-users-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

#admin-section .admin-users-table thead th {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  text-align: left;
  padding: 0.6rem 0.55rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

#admin-section .admin-users-table tbody td {
  padding: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
}

#admin-section .admin-users-table tbody tr.highlight {
  background: rgba(19, 64, 143, 0.55);
}

#admin-section .user-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

#admin-section .user-name {
  color: #ffffff;
  font-weight: 600;
}

#admin-section .user-email {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.7rem;
}

#admin-section .plan-badge,
#admin-section .status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

#admin-section .plan-badge.paid {
  background: rgba(0, 217, 255, 0.2);
  color: #9de8ff;
  border: 1px solid rgba(0, 217, 255, 0.4);
}

#admin-section .plan-badge.trial {
  background: rgba(255, 196, 0, 0.2);
  color: #ffdf7e;
  border: 1px solid rgba(255, 196, 0, 0.35);
}

#admin-section .status-badge.active {
  background: rgba(0, 217, 140, 0.2);
  color: #8cffc8;
  border: 1px solid rgba(0, 217, 140, 0.35);
}

#admin-section td.positive {
  color: #7dffb6;
  font-weight: 600;
}

#admin-section td.negative {
  color: #ff8b8b;
  font-weight: 600;
}

/* ===== Settings Page ===== */
#settings-section .settings-page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

#settings-section .settings-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

#settings-section .settings-card summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 1rem;
}

#settings-section .settings-card summary::-webkit-details-marker {
  display: none;
}

#settings-section .settings-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

#settings-section .settings-sub {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.2rem;
}

#settings-section .settings-chevron {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

#settings-section details[open] .settings-chevron {
  transform: rotate(180deg);
}

#settings-section .settings-content {
  margin-top: 0.75rem;
}

#settings-section .settings-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

#settings-section .settings-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

#settings-section .settings-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 0.6rem;
}

#settings-section .settings-row label {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.78rem;
}

#settings-section .settings-row input,
#settings-section .settings-row select {
  background: rgba(12, 14, 26, 0.9);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font-size: 0.8rem;
}

#settings-section .settings-row select,
#settings-section .settings-row select option,
.country-select,
.country-select option {
  background: #0b1220;
  color: #c7c9d1;
}

#settings-section .settings-row--inline {
  align-items: center;
}

#settings-section .settings-inline {
  display: grid;
  grid-template-columns: 140px minmax(0, 180px);
  gap: 0.5rem;
  max-width: 340px;
  align-items: center;
}

#settings-section .settings-inline input {
  width: 100%;
  max-width: 180px;
}

#settings-section .settings-edit-btn {
  align-self: flex-start;
  margin-top: 0.4rem;
  padding: 0.4rem 1.2rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #7ac8ff, #6b7bff);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(103, 132, 255, 0.35);
}

#settings-section .settings-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

#settings-section .settings-action-btn {
  align-self: flex-start;
  padding: 0.4rem 1.2rem;
  border-radius: 10px;
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#settings-section .settings-action-btn.save,
#settings-section .settings-action-btn.edit {
  background: linear-gradient(135deg, #7ac8ff, #6b7bff);
  box-shadow: 0 8px 18px rgba(103, 132, 255, 0.35);
}

#settings-section .settings-action-btn.cancel {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

#settings-section .settings-action-btn.edit,
#settings-section .settings-action-btn.cancel {
  display: none;
}

#settings-section .settings-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
  justify-content: center;
}

#settings-investing-result {
  display: none;
}

#settings-section .settings-meta-item.muted {
  color: rgba(255, 255, 255, 0.6);
}

#settings-section .settings-placeholder {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.8rem;
  margin: 0.2rem 0 0.4rem 0;
}

#settings-section .chart-history-panel {
  background: linear-gradient(135deg, rgba(28, 36, 52, 0.9), rgba(20, 26, 38, 0.95));
  border-radius: 18px;
  padding: 1rem 1.2rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 40px rgba(0, 0, 0, 0.25);
}

.chart-history-controls {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr auto 1fr;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.9rem;
}

.chart-history-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chart-history-search input {
  background: transparent;
  border: none;
  color: #fff;
  outline: none;
  width: 100%;
}

.chart-history-id-range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-history-id-range input {
  width: 90px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 10px;
  padding: 0.35rem 0.5rem;
}

.range-label {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  cursor: pointer;
}

.icon-btn.danger {
  background: rgba(244, 67, 54, 0.22);
  border-color: rgba(244, 67, 54, 0.4);
}

.icon-btn.active {
  background: rgba(255, 255, 255, 0.2);
}

.chart-history-reset {
  background: linear-gradient(135deg, #ffb020, #ff8a00);
  border: none;
  color: #1b0f00;
  font-weight: 700;
  border-radius: 12px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(255, 138, 0, 0.35);
}

.chart-history-date-range {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.date-pill {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.25rem 0.5rem;
}

.date-pill input {
  background: transparent;
  border: none;
  color: #fff;
  outline: none;
}

.chart-history-table-wrap {
  max-height: 360px;
  overflow: auto;
  border-radius: 12px;
}

.chart-history-table {
  width: 100%;
  border-collapse: collapse;
  color: #fff;
}

.chart-history-table thead th {
  text-align: left;
  padding: 0.5rem 0.6rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.chart-history-table tbody td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.chart-history-table .chart-history-action {
  width: 32px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: rgba(244, 67, 54, 0.25);
  color: #fff;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .chart-history-controls {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .chart-history-date-range {
    justify-content: flex-start;
  }
}

#settings-section .account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 1.2rem 1.8rem;
}

#settings-section .account-col {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

#settings-section .account-row {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  align-items: center;
  gap: 0.6rem;
}

#settings-section .account-row label {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
}

#settings-section .account-row input {
  background: #1c1c1c;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
}

#settings-section .account-row input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.05);
}

#settings-section .account-row--password .account-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

#settings-section .account-eye {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #1c1c1c;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#settings-section .account-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 0.8rem;
  margin-top: 0.3rem;
}

#settings-section .account-btn {
  border: none;
  border-radius: 12px;
  padding: 0.6rem 1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}

#settings-section .account-btn.save {
  background: linear-gradient(135deg, #6a7cff, #8d6bff);
}

#settings-section .account-btn.danger {
  background: linear-gradient(135deg, #ff4d4d, #d63a3a);
}

/* ===== My Profile Page ===== */
#profile-section .profile-page {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.2rem;
  align-items: start;
  margin-top: 0.75rem;
}

#profile-section .profile-sidebar {
  background: linear-gradient(180deg, rgba(124, 92, 196, 0.55), rgba(88, 62, 160, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  align-items: stretch;
}

#profile-section .profile-block-title {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

#profile-section .profile-block {
  text-align: left;
}

#profile-section .profile-kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.25rem 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.78rem;
}

#profile-section .profile-key {
  opacity: 0.9;
}

#profile-section .profile-value {
  color: #f4f4ff;
  font-weight: 700;
  white-space: nowrap;
}

#profile-section .profile-value.positive {
  color: #7dffb6;
}

#profile-section .profile-value.accent {
  color: #7fe6ff;
}

#profile-section .profile-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
}

#profile-section .profile-card {
  width: 100%;
  background: linear-gradient(135deg, rgba(124, 92, 196, 0.5), rgba(88, 62, 160, 0.6));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 1rem 1.1rem 1.1rem 1.1rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

#profile-section .profile-card--secondary {
  padding: 0.8rem 1.1rem;
}

#profile-section .profile-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
}

#profile-section .profile-card-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

#profile-section .profile-collapse-btn {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
  cursor: pointer;
}

#profile-section .profile-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

#profile-section .profile-summary-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: center;
  text-align: center;
}

#profile-section .profile-summary-label {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.75rem;
  font-weight: 600;
}

#profile-section .profile-summary-value {
  color: #7fe6ff;
  font-size: 0.95rem;
  font-weight: 700;
}

#profile-section .profile-table {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

#profile-section .profile-table-row {
  display: grid;
  grid-template-columns: 0.6fr 0.9fr 0.8fr repeat(6, 0.9fr);
  gap: 0.4rem;
  align-items: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
}

#profile-section .profile-table-head {
  color: rgba(127, 230, 255, 0.95);
  font-weight: 700;
  font-size: 0.7rem;
}

#profile-section .profile-chart {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 0.8rem 0.9rem 0.9rem 0.9rem;
  display: grid;
  gap: 0.6rem;
}

#profile-section .profile-chart-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.2rem;
  width: fit-content;
  margin: 0 auto;
}

#profile-section .profile-chart-toggle-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

#profile-section .profile-chart-toggle-btn.is-active {
  background: rgba(127, 230, 255, 0.2);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(127, 230, 255, 0.4);
}

#profile-section .profile-chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.72rem;
}

#profile-section .profile-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

#profile-section .profile-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #7fe6ff;
  box-shadow: 0 0 10px rgba(127, 230, 255, 0.6);
}

#profile-section .profile-chart-graph {
  position: relative;
  height: 210px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(124, 92, 196, 0.35), rgba(88, 62, 160, 0.25)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 24px);
  overflow: hidden;
}

#profile-section .profile-chart-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#profile-section .profile-chart-graph::after {
  display: none;
}

#profile-section .profile-chart-tooltip {
  position: absolute;
  right: auto;
  bottom: auto;
  background: rgba(40, 30, 80, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.35rem 0.55rem;
  color: #ffffff;
  font-size: 0.72rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  text-align: left;
  z-index: 2;
  pointer-events: none;
  width: fit-content;
  max-width: none;
  line-height: 1.1;
  display: inline-grid;
  gap: 0.25rem;
  white-space: nowrap;
}

#profile-section .profile-tooltip-row {
  display: inline-flex;
  justify-content: space-between;
  gap: 0.45rem;
}

#profile-section .profile-chart-axis {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.7rem;
  padding: 0 0.2rem;
}

#profile-section .profile-axis-label {
  min-width: 40px;
  text-align: center;
}

#profile-section .profile-tooltip-value {
  color: #7fe6ff;
  font-weight: 700;
  font-size: 0.85rem;
}

@media (max-width: 1100px) {
  #profile-section .profile-page {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  #profile-section .profile-table-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #settings-section .account-grid {
    grid-template-columns: 1fr;
  }
  #settings-section .account-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  #settings-section .settings-grid {
    grid-template-columns: 1fr;
  }
  #settings-section .settings-row {
    grid-template-columns: 1fr;
  }
  #settings-section .settings-inline {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  #admin-section .admin-layout {
    grid-template-columns: 1fr;
  }
  #admin-section .admin-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  #admin-section .admin-sidebar-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  #admin-section .admin-chart-card--wide {
    grid-column: span 1;
  }
  #admin-section .admin-charts-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

.btn-sm {
  padding: 0.45rem 0.8rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
}

.btn-primary {
  background: linear-gradient(135deg, var(--stocks-row-grad-start), var(--stocks-row-grad-end));
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ===== Dividends Page Spacing ===== */
/* Keep ~2mm gap between the switch and chart/table on both subpages */
#dividends-section .chart-container {
  margin-top: 2mm !important;    /* default top spacing */
  margin-bottom: 2mm !important; /* gap before the switch/table */
}
/* Monthly: increase top gap to ~1cm from menu bar */
#dividends-section.monthly-view .chart-container {
  margin-top: 1cm !important;
}
/* Annual: keep 2mm top spacing */
#dividends-section.annual-view .chart-container {
  margin-top: 2mm !important;
}
/* Remove any extra top margins inside chart container */
#dividends-section .chart-container h2 {
  margin-top: 0 !important;
}
#dividends-section #dividends-monthly-table {
  margin-top: 2mm !important;
}
#dividends-section #dividends-annual-subpage {
  margin-top: 2mm !important;
}

.btn-danger {
  background: linear-gradient(135deg, #f44336, #d32f2f);
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.btn-warning {
  background: linear-gradient(135deg, #ffc107, #ff9800);
  color: #1b1b1b;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}

.snapshots-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.snapshots-stats.compact {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-card.mini {
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
}
.stat-card.mini .stat-label { font-size: 0.8rem; }
.stat-card.mini span:last-child { font-size: 1.1rem; }

@media (max-width: 980px) {
  .admin-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-hero { padding: 0.8rem 1rem; }
}

.stat-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  font-weight: 500;
}

.stat-card span:last-child {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
}

#snapshots-tbody tr {
  background: rgba(255, 255, 255, 0.05);
}

#snapshots-tbody tr:hover {
  background: rgba(255, 255, 255, 0.1);
}

.delete-snapshot-btn {
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.delete-snapshot-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

/* Dividends Table Styles */
#dividends-table {
  width: 800px;
  max-width: 90%;
  margin: 0 auto;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Withdrawals table styled identic cu Dividends */
#withdrawals-table {
  width: 800px;
  max-width: 90%;
  margin: 0 auto 2rem auto;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Withdrawals summary panel */
.withdrawals-summary-panel {
  max-width: 800px;
  margin: 0.5rem auto 1.2rem auto;
  background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.05));
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 16px;
  padding: 0.85rem 1rem 0.9rem 1rem;
  box-shadow: 0 14px 36px rgba(0,0,0,0.38), inset 0 1px 0 rgba(255,255,255,0.3);
}
.withdrawals-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}
.withdrawals-summary-item {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 0.6rem 0.75rem 0.55rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.withdrawals-summary-item .label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
}
.withdrawals-summary-item .value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 6px rgba(255,255,255,0.35);
}
@media (max-width: 600px) {
  .withdrawals-summary-item { padding: 0.55rem 0.65rem; }
  .withdrawals-summary-item .value { font-size: 0.95rem; }
}

#withdrawals-table thead {
  background: rgba(255, 255, 255, 0.2);
}

#withdrawals-table th {
  padding: 0.25rem; /* compact */
  text-align: left;
  font-weight: bold;
  color: white;
  font-size: 0.8rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

#withdrawals-table td {
  padding: 0.25rem; /* compact */
  text-align: left;
  color: white;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.75rem;
}

#withdrawals-table tbody tr {
  background: linear-gradient(135deg, rgba(0,0,0,0.476), rgba(0,0,0,0.34));
  transition: background 0.25s ease;
}

#withdrawals-table tbody tr:hover {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.503), rgba(0, 0, 0, 0.367));
}

#withdrawals-section .floating-add-btn {
  bottom: 40px;
  right: 40px;
}

#dividends-section .chart-container {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  border: 1px solid rgba(255, 255, 255, 0.18);
  width: 100%;
  max-width: 100%;
  min-height: 400px;
}

/* Dashboard: match Dividends chart panel look */
#dashboard-section .chart-container,
#dashboard-section .performance-chart-container,
#dashboard-section .wide-panel-container {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

#dividends-table thead {
  background: rgba(255, 255, 255, 0.2);
}

#dividends-table th {
  padding: 0.25rem; /* further compact */
  text-align: left;
  font-weight: bold;
  color: white;
  font-size: 0.8rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

#dividends-table td {
  padding: 0.25rem; /* further compact */
  text-align: left;
  color: white;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
}

#dividends-table tbody tr:hover {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.503), rgba(0, 0, 0, 0.367));
}

/* Normal dividends rows match Stocks gradient */
#dividends-table tbody tr {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.476), rgba(0, 0, 0, 0.34));
}

#dividends-table td[contenteditable='true'] {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  cursor: text;
}

#dividends-table td[contenteditable='true']:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

#dividends-table .year-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem;
  width: 100%;
  font-size: 0.85rem;
  border-radius: 3px;
  cursor: pointer;
}

#dividends-table .year-select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

#dividends-table .year-select option {
  background: var(--stocks-row-grad-start);
  color: white;
  padding: 0.5rem;
}

#dividends-table .monthly-dividend {
  color: #64ffda;
  font-weight: 600;
}

#dividends-table .editable {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 0.4rem 0.5rem;
  min-height: 2rem;
  height: 2rem;
  display: block;
  line-height: 1.2;
  width: calc(100% - 2px);
  box-sizing: border-box;
  text-align: left;
  margin: 0;
}

#dividends-table .editable:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

#dividends-table .year-cell {
  font-weight: 500;
  vertical-align: middle;
  padding: 0.5rem !important;
  width: 120px;
}

#dividends-table .annual-dividend-cell {
  font-weight: 500;
  vertical-align: middle;
  padding: 0.5rem !important;
  padding-left: 1.5rem !important;
  width: 180px;
}

#dividends-table .year-select {
  height: 2rem;
  line-height: 1.2;
  padding: 0.4rem 0.5rem;
  box-sizing: border-box;
}

#dividends-table .delete-btn {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

#dividends-table .delete-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

#dividends-table .save-icon-btn,
#dividends-table .cancel-icon-btn,
#dividends-table .delete-icon-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  transition: all 0.2s ease;
  opacity: 0.7;
}

#dividends-table .save-icon-btn:hover {
  opacity: 1;
  transform: scale(1.2);
  color: #4caf50;
}

#dividends-table .edit-icon-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  transition: all 0.2s ease;
  opacity: 0.7;
}

#dividends-table .edit-icon-btn:hover {
  opacity: 1;
  transform: scale(1.2);
  color: #4fc3f7;
}

#dividends-table .cancel-icon-btn:hover,
#dividends-table .delete-icon-btn:hover {
  opacity: 1;
  transform: scale(1.2);
  color: #ff6b6b;
}

#dividends-table tr.editing {
  background: rgba(102, 126, 234, 0.1);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    background: rgba(102, 126, 234, 0.1);
  }
  50% {
    background: rgba(102, 126, 234, 0.2);
  }
}

/* Dividends Monthly Table: match Annual visuals */
#dividends-monthly-table {
  width: 100%;
  max-width: 100%;
  min-width: 1200px;
  margin: 0 auto;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  display: block;
  overflow-x: auto;
}

#dividends-monthly-table thead {
  background: rgba(255, 255, 255, 0.2);
}

#dividends-monthly-table th {
  padding: 0.25rem; /* compact like annual */
  text-align: left;
  font-weight: bold;
  color: white;
  font-size: 0.8rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

#dividends-monthly-table td {
  padding: 0.25rem; /* compact like annual */
  text-align: left;
  color: white;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  white-space: nowrap;
}

#dividends-monthly-table .tax-percent-input {
  width: 70px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.75rem;
}

#dividends-monthly-table .withdraw-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #4fc3f7;
}

#dividends-monthly-table tbody tr {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.476), rgba(0, 0, 0, 0.34));
}

#dividends-monthly-table tbody tr:hover {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.503), rgba(0, 0, 0, 0.367));
}

/* Stocks Gains Table: match screenshot style */
#stocks-gains-table {
  width: 100%;
  max-width: 100%;
  min-width: 1200px;
  margin: 0 auto;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  display: block;
  overflow-x: auto;
}

#stocks-gains-table thead {
  background: rgba(255, 255, 255, 0.22);
}

#stocks-gains-table th {
  padding: 0.3rem 0.4rem;
  text-align: left;
  font-weight: 700;
  color: white;
  font-size: 0.82rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

#stocks-gains-table td {
  padding: 0.3rem 0.4rem;
  text-align: left;
  color: white;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  white-space: nowrap;
}

#stocks-gains-table tbody tr {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.44), rgba(0, 0, 0, 0.32));
}

#stocks-gains-table tbody tr:hover {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.36));
}

#stocks-gains-table .edit-icon-btn,
#stocks-gains-table .delete-icon-btn,
#stocks-gains-table .save-icon-btn,
#stocks-gains-table .cancel-icon-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  transition: all 0.2s ease;
  opacity: 0.8;
}

#stocks-gains-table .edit-icon-btn:hover,
#stocks-gains-table .save-icon-btn:hover {
  opacity: 1;
  transform: scale(1.15);
  color: #4fc3f7;
}

#stocks-gains-table .delete-icon-btn:hover,
#stocks-gains-table .cancel-icon-btn:hover {
  opacity: 1;
  transform: scale(1.15);
  color: #ff6b6b;
}

#stocks-gains-table .tax-percent-input {
  width: 70px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.75rem;
}

#stocks-gains-table .withdraw-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #4fc3f7;
}

/* ===== Taxes panels ===== */
.taxes-page {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

#taxes-section .settings-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

#taxes-section .settings-card summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 1rem;
}

#taxes-section .settings-card summary::-webkit-details-marker {
  display: none;
}

#taxes-section .settings-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

#taxes-section .settings-sub {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.2rem;
}

#taxes-section .settings-chevron {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

#taxes-section details[open] .settings-chevron {
  transform: rotate(180deg);
}

#taxes-section .settings-content {
  margin-top: 0.75rem;
}

#taxes-section .taxes-empty {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  padding: 0.5rem 0.1rem 0.2rem;
}

.taxes-panels {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 0.75rem;
}

#taxes-section .taxes-panel {
  background: linear-gradient(135deg, rgba(24, 28, 42, 0.96), rgba(16, 20, 32, 0.98)) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35) !important;
  overflow: hidden !important;
  max-width: 490px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

#taxes-section .taxes-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem !important;
  cursor: pointer;
  color: #e6e9f2;
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)) !important;
}

#taxes-section .taxes-panel-title {
  font-size: 1rem;
  letter-spacing: 0.3px;
}

#taxes-section .taxes-panel-toggle {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  color: #fff;
  font-size: 0.9rem;
}

#taxes-section .taxes-panel-body {
  padding: 0.7rem 1.1rem 1rem !important;
}

#taxes-section .taxes-panel-body.is-collapsed {
  display: none;
}

#taxes-section .taxes-table {
  width: 100% !important;
  max-width: 860px !important;
  margin: 0 auto !important;
  border-collapse: collapse !important;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.2)) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}

#taxes-section .taxes-table th,
#taxes-section .taxes-table td {
  padding: 0.5rem 0.6rem;
  text-align: left;
  font-size: 0.82rem;
  color: #f0f0f4;
}

#taxes-section .taxes-table thead th {
  color: #ffffff;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
}

#taxes-section .taxes-table tbody tr {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#taxes-section .taxes-table tfoot td {
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  font-weight: 700;
  color: #ffffff;
}
}

/* Brand / Navbar logo styles */
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.brand-title {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.4px;
  color: #ffffff;
  text-shadow: 0 1px 12px rgba(102, 126, 234, 0.45);
}

/* Optional: slightly enlarge on hover for a premium feel */
.brand-link:hover .brand-logo {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}
.brand-link:hover .brand-title {
  filter: brightness(1.15);
}
