/* ═══ 淺色模式（預設，符合截圖風格） ═══ */
:root {
  --bg: #f5f3ee;
  --bg-grad: #f5f3ee;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --panel-2: #faf8f4;
  --panel-3: #efece4;
  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.12);
  --text: #1a2620;
  --text-2: #2d3a33;
  --muted: #7a8278;
  --subtle: #a8ada3;
  --topbar-bg: rgba(245, 243, 238, 0.85);
  --modal-bg-overlay: rgba(20, 30, 25, 0.45);
  --table-header-bg: #faf8f4;
  --input-bg: #ffffff;
  --shadow-sm: 0 1px 2px rgba(20, 40, 30, 0.04);
  --shadow: 0 4px 14px rgba(20, 40, 30, 0.06);
  --shadow-lg: 0 20px 50px rgba(20, 40, 30, 0.15);
  --scrollbar-thumb: #d1d5c8;
}

/* ═══ 深色模式 ═══ */
[data-theme="dark"] {
  --bg: #0f1315;
  --bg-grad: #0f1315;
  --panel: #181d1f;
  --panel-solid: #181d1f;
  --panel-2: #202628;
  --panel-3: #283135;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f0f5f2;
  --text-2: #d1dad5;
  --muted: #a3b3aa;
  --subtle: #73827a;
  --topbar-bg: rgba(15, 19, 21, 0.85);
  --modal-bg-overlay: rgba(0, 0, 0, 0.75);
  --table-header-bg: #202628;
  --input-bg: #202628;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.7);
  --scrollbar-thumb: #334045;

  --green: #4fb395;
  --green-dark: #2c5e4f;
  --green-light: #6ed1b1;
  --gold: #f2ae4b;
  --gold-light: #f7cb85;
  --orange: #e89554;
  --up: #f05a5a;
  --up-soft: rgba(240, 90, 90, 0.15);
  --down: #46b880;
  --down-soft: rgba(70, 184, 128, 0.15);
  --flat: #a3b3aa;
}

/* ═══ 共用色 ═══ */
:root {
  --green: #2c5e4f;
  --green-dark: #1e4538;
  --green-light: #4a8270;
  --gold: #d68a2c;
  --gold-light: #e8a849;
  --orange: #c97939;
  --up: #d83a3a;
  --up-soft: rgba(216, 58, 58, 0.1);
  --down: #2c8055;
  --down-soft: rgba(44, 128, 85, 0.1);
  --flat: #8a948c;
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --num-font: "Noto Sans TC", "微軟正黑體", "Microsoft JhengHei", sans-serif;
}

* {
  box-sizing: border-box;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 10px;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: var(--base-font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.amount,
.price,
.pct,
.shares,
.fmtMoney {
  font-family: var(--num-font);
}

button {
  font-family: inherit;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.center {
  text-align: center;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--num-font);
}

.hidden {
  display: none !important;
}

.gold {
  color: var(--gold);
}

.up {
  color: var(--up);
}

.down {
  color: var(--down);
}

.flat {
  color: var(--flat);
}

/* ═══════════════════════════ TopBar ═══════════════════════════ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

body {
  padding-top: 65px;
}

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

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--green);
  color: #fff;
  border-radius: 10px;
  font-size: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.topbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ═══════════════════════════ Buttons ═══════════════════════════ */
.btn {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 8px 16px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
  background: var(--panel-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-primary {
  background: var(--green);
  border: 1px solid var(--green);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-2);
}

.btn-secondary:hover {
  background: var(--panel);
  border-color: var(--text-2);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

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

.page-size-select {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.page-size-select:focus {
  border-color: var(--primary);
}

[data-theme="dark"] .page-size-select {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-danger {
  background: transparent;
  color: var(--up);
  border-color: rgba(216, 58, 58, 0.35);
}

.btn-danger:hover {
  background: var(--up-soft);
  border-color: var(--up);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  transition: all 0.15s;
}

.btn-icon:hover {
  background: var(--panel-3);
  color: var(--text);
  transform: translateY(-2px);
}

.btn-icon-round {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: all 0.15s;
}

.btn-icon-round:hover {
  background: var(--panel-3);
  color: var(--text);
  transform: translateY(-2px);
}

.btn-back {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 26px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: all 0.15s;
}

.btn-back:hover {
  background: var(--panel-3);
  transform: translateY(-2px);
}

/* ═══════════════════════════ 備註圖示互動特效 ═══════════════════════════ */
.note-icon {
  display: inline-flex;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s ease;
  transform-origin: center;
}

.note-icon:hover {
  transform: scale(1.25);
  filter: brightness(1.15);
  /* 輕微增亮，營造發光感 */
}

.note-icon:active {
  transform: scale(0.9) !important;
  /* 點擊時縮小下壓 */
}

/* ═══════════════════════════ Layout ═══════════════════════════ */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 32px 80px;
}

.block-title {
  font-size: 14px;
  color: var(--muted);
  margin: 4px 4px 14px;
}

.block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px 26px;
  margin-bottom: 22px;
  transition: background 0.3s ease;
}

.block h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.block-header h2 {
  margin: 0;
}

/* ═══════════════════════════ Overview Row ═══════════════════════════ */
.overview-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
  margin-bottom: 22px;
}

.overview-main {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
}

.ov-label {
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.ov-value {
  font-size: 44px;
  font-weight: 800;
  font-family: var(--num-font);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 28px;
}

.ov-sub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  margin-top: auto;
}

.ov-sub-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.ov-sub-value {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--num-font);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.ov-sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--panel-3);
  color: var(--text);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--num-font);
}

.rank-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rank-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 22px;
  text-align: center;
  position: relative;
}

.rank-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 6px;
}

.rank-icon-gold {
  background: rgba(214, 138, 44, 0.15);
}

.rank-icon-red {
  background: rgba(216, 58, 58, 0.12);
}

.rank-title {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.rank-main {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
}

.rank-amount {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--num-font);
  margin-top: 4px;
}

/* ═══════════════════════════ Chart Row ═══════════════════════════ */
.chart-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
  margin-bottom: 22px;
}

.chart-row .block {
  margin-bottom: 0;
}

.monthly-chart {
  width: 100%;
  height: 220px;
  position: relative;
}

.monthly-chart svg {
  width: 100%;
  height: 100%;
}

.monthly-chart .bar-group {
  cursor: pointer;
}

.monthly-chart .bar-group rect {
  transition:
    transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    filter 0.2s ease;
  transform-box: fill-box;
  transform-origin: bottom center;
}

.monthly-chart .bar-group .bar-text {
  transition:
    transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    filter 0.2s ease;
  transform-box: fill-box;
  transform-origin: bottom center;
}

.monthly-chart .bar-group:hover rect {
  transform: scale(1.15, 1.05);
  filter: brightness(1.15);
}

.monthly-chart .bar-group:hover .bar-text {
  transform: scale(1.15) translateY(-2px);
  filter: brightness(1.2);
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  background: var(--panel-2);
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.chart-legend .dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.activity-block {
  display: flex;
  flex-direction: column;
}

.activity-list {
  flex: 1;
  overflow-y: auto;
  max-height: 290px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 40px;
  /* 讓最後一筆資料能完全滾動出淡出區域 */
  /* 底部漸層淡出視覺效果 */
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 40px), transparent 100%);
  mask-image: linear-gradient(to bottom, black calc(100% - 40px), transparent 100%);
}

.activity-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 4px;
  opacity: 0;
  animation: fadeSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.activity-icon.buy {
  background: rgba(44, 94, 79, 0.12);
  color: var(--green);
}

.activity-icon.reinvest {
  background: rgba(214, 138, 44, 0.18);
  color: var(--gold);
}

.activity-icon.dividend {
  background: rgba(216, 58, 58, 0.12);
  color: var(--up);
}

.activity-icon.sell {
  background: rgba(140, 106, 79, 0.15);
  color: var(--earth);
}

.activity-icon.split {
  background: color-mix(in srgb, var(--earth) 15%, transparent);
  color: var(--earth);
}

.activity-body {
  flex: 1;
  min-width: 0;
}

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

.activity-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.activity-date {
  font-size: 11px;
  color: var(--subtle);
  margin-top: 4px;
  font-family: var(--num-font);
}

/* ═══════════════════════════ Holdings Grid ═══════════════════════════ */
.seg-toggle {
  display: inline-flex;
  background: var(--panel-3);
  border-radius: 999px;
  padding: 3px;
}

.seg {
  background: transparent;
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.seg.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.split-type-btn {
  background: var(--panel-2);
  border: 2px solid var(--border-strong);
  color: var(--text-2);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
}

.split-type-btn:hover {
  border-color: var(--primary);
  background: var(--panel);
}

.split-type-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.holdings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.holding-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
  position: relative;
  cursor: pointer;
  transition: all 0.18s;
  overflow: hidden;
}

.holding-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.holding-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent, var(--green));
}

.hc-row1 {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.hc-symbol {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--num-font);
  color: var(--text);
}

.hc-name {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.hc-price {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--num-font);
  color: var(--green);
  text-align: right;
  letter-spacing: -0.02em;
}

.hc-price.up {
  color: var(--up);
}

.hc-price.down {
  color: var(--down);
}

.hc-shares {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  margin-top: 2px;
}

.hc-cost-box {
  margin-top: 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.hc-cost-label {
  font-size: 11px;
  color: var(--muted);
}

.hc-cost-value {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--num-font);
  color: var(--text);
  margin-top: 2px;
}

.hc-cost-alt {
  font-size: 11px;
  color: var(--up);
  margin-top: 4px;
}

.hc-arrow {
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: var(--muted);
  font-size: 16px;
}

.hc-delete {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--subtle);
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 14px;
  opacity: 0;
  transition:
    opacity 0.15s,
    transform 0.15s;
}

.holding-card:hover .hc-delete {
  opacity: 1;
}

.hc-delete:hover {
  color: var(--up);
  background: var(--up-soft);
  transform: translateY(-2px);
}

/* ═══════════════════════════ Ratio Row (Donut) ═══════════════════════════ */
.ratio-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.ratio-row .block {
  margin-bottom: 0;
}

.donut-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 260px;
}

.donut-wrap svg {
  max-width: 240px;
  max-height: 240px;
  overflow: visible;
  /* 避免放大時被裁切 */
}

.donut-slice-group {
  transition:
    transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    filter 0.2s ease;
  transform-origin: 110px 110px;
  cursor: pointer;
}

.donut-slice-group:hover {
  transform: scale(1.08);
  filter: brightness(1.15);
}

.ratio-legend-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ratio-legend-row {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  grid-template-rows: auto 6px;
  gap: 6px 10px;
  align-items: center;
  font-size: 13px;
}

.ratio-legend-row .legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ratio-legend-row .lr-name {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ratio-legend-row .lr-pct {
  color: var(--muted);
  font-family: var(--num-font);
  font-size: 12px;
  width: 50px;
  text-align: right;
}

.ratio-legend-row .lr-amt {
  font-family: var(--num-font);
  color: var(--text);
  font-size: 12px;
}

.ratio-legend-bar {
  grid-column: 2/-1;
  height: 4px;
  background: var(--panel-3);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.ratio-legend-bar>div {
  height: 100%;
}

.ratio-body {
  display: flex;
  align-items: center;
  gap: 24px;
}

.ratio-body .donut-wrap {
  flex: 0 0 auto;
  height: 240px;
}

.ratio-body .ratio-legend-list {
  flex: 1;
  min-width: 0;
  max-height: 260px;
  overflow-y: auto;
}

/* ═══════════════════════════ Stock Detail View ═══════════════════════════ */
.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 18px;
}

.detail-symbol {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--num-font);
  letter-spacing: -0.01em;
}

.detail-name {
  font-size: 13px;
}

.detail-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  position: relative;
}

.detail-summary::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--orange);
  border-radius: var(--r) var(--r) 0 0;
}

.ds-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ds-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.ds-value {
  font-size: 44px;
  font-weight: 800;
  font-family: var(--num-font);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
  text-align: right;
}

.ds-unit {
  font-size: 16px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 4px;
}

.ds-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  /* 內部兩行文字向右對齊 */
  align-self: flex-end;
  /* 整個綠色標籤向右對齊 */
  padding: 8px 14px;
  border-radius: 12px;
  /* 改為圓角矩形，更適合多行文字 */
  font-size: 13px;
  font-weight: 700;
  background: var(--down-soft);
  color: var(--down);
  margin-top: 4px;
}

.ds-pill.up {
  background: var(--up-soft);
  color: var(--up);
}

.ds-profit-box {
  margin-top: 18px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
}

.ds-profit-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.ds-profit-value {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--num-font);
  color: var(--up);
  text-align: right;
}

.ds-profit-value.down {
  color: var(--down);
}

.ds-profit-sub {
  font-size: 12px;
  margin-top: 4px;
  text-align: right;
}

.ds-right {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14.4px;
  align-content: center;
}

.ds-mini-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14.4px 16.8px;
  display: flex;
  flex-direction: column;
  gap: 7.2px;
  transition: all 0.2s ease;
}

.ds-mini-card .muted {
  font-size: 13px;
  line-height: 1.4;
}

/* ════ 專屬深色模式的高質感微透明卡片 (解決框框很醜的問題) ════ */
[data-theme="dark"] .ds-mini-card,
[data-theme="dark"] .chart-legend span,
[data-theme="dark"] .activity-item,
[data-theme="dark"] .rank-sub-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.02);
}

.ds-mini-card .val {
  font-family: var(--num-font);
  font-weight: 700;
  color: var(--text);
  font-size: 19.2px;
  text-align: right;
}

.ds-mini-card .val.up {
  color: var(--up);
}

.ds-mini-card .val.down {
  color: var(--down);
}

.ds-mini-card .val.flat {
  color: var(--flat);
}

.ds-mini-card .val.muted {
  color: var(--muted);
}

.ds-mini-card .val.gold {
  color: var(--gold);
}

.detail-danger {
  text-align: right;
  padding: 16px 22px;
}

/* ═══════════════════════════ Sub Table ═══════════════════════════ */
.table-wrap {
  overflow-x: auto;
}

.sub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sub-table th,
.sub-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.sub-table td.num {
  padding-right: 20px;
}

.sub-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--panel-2);
  padding: 12px 14px 24px 14px;
}

.sub-table th.num,
.sub-table td.num {
  text-align: right;
  font-family: var(--num-font);
}

.sub-table td.center {
  text-align: center;
}

.sub-table tbody tr:hover {
  background: var(--panel-2);
}

/* ═══════════════════════════ Modal ═══════════════════════════ */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.18s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-bg {
  position: absolute;
  inset: 0;
  background: var(--modal-bg-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-box {
  position: relative;
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 0;
  width: 92%;
  max-width: 460px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 10px 22px;
  overflow-y: auto;
}

#termTipBody p:first-child {
  margin-top: 0;
  margin-bottom: 26px;
}

/* ═══════════════════════════ Form ═══════════════════════════ */
.form-row {
  margin-bottom: 14px;
}

.form-row label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
}

.form-row input,
.form-row select {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(44, 94, 79, 0.15);
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.lookup-hint {
  margin: 8px 0 4px;
  padding: 8px 12px;
  background: var(--panel-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

/* ═══════════════════════════ Spinner 動畫 ═══════════════════════════ */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}

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

/* ═══════════════════════════ Toast ═══════════════════════════ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--r-sm);
  z-index: 200;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.toast.error {
  border-color: var(--up);
  color: var(--up);
}

.toast.success {
  border-color: var(--down);
  color: var(--down);
}

/* ═══════════════════════════ 刪除過渡動畫 ═══════════════════════════ */
.removing td {
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.removing {
  background-color: var(--up-soft) !important;
}

.removing-card {
  opacity: 0 !important;
  transform: scale(0.9) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  pointer-events: none;
}

/* ═══════════════════════════ RWD ═══════════════════════════ */
@media (max-width: 1000px) {

  .overview-row,
  .chart-row,
  .ratio-row,
  .detail-summary {
    grid-template-columns: 1fr;
  }
}

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

  .ratio-body .donut-wrap {
    height: 200px;
  }

  .topbar {
    padding: 14px 18px;
    flex-wrap: wrap;
    gap: 10px;
  }

  body {
    padding-top: 58px;
  }

  .topbar-right {
    display: contents !important;
  }

  .brand {
    flex: 1 1 auto;
  }

  #mainDropdown {
    order: 2;
  }

  .topbar h1 {
    font-size: 16px;
  }

  main {
    padding: 16px 18px 60px;
  }

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

  .ov-sub-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

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

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

/* ═══════════════════════════ 表格間距優化 ═══════════════════════════ */
/* 增加表格標題與內容間的距離 */
.sub-table tbody tr:first-child td {
  padding-top: 16px;
}

/* ═══════════════ Main Tab Nav (大分頁) ═══════════════ */
.main-tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.main-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
}

.main-tab:hover {
  color: var(--text);
}

.main-tab.active {
  color: var(--text);
  border-bottom-color: var(--gold);
}

.main-tab-panel.hidden {
  display: none;
}

/* ═══════════════════════════ Goals Panel ═══════════════════════════ */
.goals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 4px 0 8px;
}

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

.goal-card {
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.goal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.goal-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.goal-add-btn {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s,
    box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(44, 94, 79, 0.25);
}

.goal-add-btn:hover {
  background: var(--green-dark);
  box-shadow: 0 4px 12px rgba(44, 94, 79, 0.35);
}

.goal-add-btn:active {
  transform: scale(0.95);
}

.goal-stat-row {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

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

.goal-stat-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.goal-stat-value {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--num-font, monospace);
  color: var(--text);
  line-height: 1.1;
}

.goal-stat-value.accent {
  color: var(--green);
}

.goal-stat-sub {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}

/* Progress Bar */
.goal-bar-wrap {
  position: relative;
  width: 100%;
  height: 56px;
  background: var(--panel-3);
  border-radius: 10px;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.06),
    var(--shadow);
  overflow: hidden;
  margin-bottom: 8px;
}

.goal-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green-light, #6ed1b1) 0%, var(--green, #2c5e4f) 100%);
  border-radius: 10px;
  transition: width 0.5s ease-out;
  min-width: 0;
}

.goal-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--num-font, monospace);
  color: var(--text);
  z-index: 1;
  pointer-events: none;
}

@media (max-width: 480px) {
  .goal-bar-text {
    font-size: 12px;
  }
}

.goal-bar-pct {
  font-size: 26px;
  font-weight: 800;
  color: var(--green);
  font-family: var(--num-font, monospace);
  text-align: right;
  margin-bottom: 4px;
}

.goal-bar-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  margin-top: 6px;
}

.goal-bar-ticks span {
  font-size: 11px;
  color: var(--subtle, #a8ada3);
}

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

.goal-empty-icon {
  font-size: 40px;
  opacity: 0.4;
}

.goal-empty-title {
  font-size: 15px;
  color: var(--muted);
  font-weight: 600;
}

.goal-empty-hint {
  font-size: 13px;
  color: var(--subtle);
}

/* Placeholder card */
.goal-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 60px 20px;
  text-align: center;
  opacity: 0.6;
}

/* Goal modal */
.goal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: goalFadeIn 0.3s ease;
}

.goal-modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: 340px;
  max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-lg);
  animation: goalZoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes goalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

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

.goal-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 20px;
}

.goal-modal-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
}

.goal-modal-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 16px;
  font-family: var(--num-font, monospace);
  background: var(--input-bg);
  color: var(--text);
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}

.goal-modal-input:focus {
  border-color: var(--green);
}

.goal-modal-hint {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(44, 94, 79, 0.08);
  border: 1px solid rgba(44, 94, 79, 0.2);
  border-radius: 8px;
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
  font-family: var(--num-font, monospace);
}

.goal-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.goal-modal-actions .btn {
  flex: 1;
  padding: 10px 0;
}

.goal-modal-confirm {
  flex: 1;
  padding: 10px 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
}

.goal-modal-confirm:not(:disabled) {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(44, 94, 79, 0.3);
}

.goal-modal-confirm:not(:disabled):hover {
  background: var(--green-dark);
}

.goal-modal-confirm:not(:disabled):active {
  transform: scale(0.97);
}

.goal-modal-confirm:disabled {
  background: var(--panel-3);
  color: var(--subtle);
  cursor: not-allowed;
}

/* 目標配息模組 */
.goal-div-month-info {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 14px;
}

.goal-div-achieved {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--down);
  padding: 8px 4px;
}

.goal-div-hint {
  font-size: 14px;
  color: var(--subtle);
  margin-top: 10px;
  padding: 7px 10px;
  background: var(--panel-2);
  border-radius: 6px;
  line-height: 1.5;
}

/* ═══════════════════════════ 股利行事曆 ═══════════════════════════ */

#calAnimalBanner {
  display: flex;
  justify-content: center;
  margin: 2px 0 14px;
  opacity: 0.82;
  transition: opacity 0.3s ease;
}

#calAnimalBanner:hover {
  opacity: 1;
}

#calAnimalBanner svg {
  width: 80px;
  height: 80px;
  color: var(--primary);
  transition:
    color 0.3s ease,
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#calAnimalBanner svg:hover {
  transform: scale(1.1) rotate(-4deg);
}

@media (max-width: 768px) {
  #calAnimalBanner svg {
    width: 56px;
    height: 56px;
  }
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 14px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel-3));
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

.cal-dow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  padding: 6px 4px 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* 週六、週日標頭著金/橘色 */
.cal-dow:nth-child(6) {
  color: var(--gold);
}

.cal-dow:nth-child(7) {
  color: var(--orange);
}

.cal-day {
  position: relative;
  background: var(--panel);
  min-height: 96px;
  padding: 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    border-color 0.14s ease;
}

.cal-day:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

/* 週末日格淡淡著色 */
.cal-day:nth-child(7n),
.cal-day:nth-child(7n + 1) {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
}

.cal-day.cal-other-month {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  opacity: 0.45;
}

.cal-day.cal-other-month:hover {
  transform: none;
}

.cal-day.cal-today {
  border-color: var(--primary);
  background: linear-gradient(165deg,
      color-mix(in srgb, var(--primary) 12%, var(--panel)),
      var(--panel));
  box-shadow: 0 4px 16px color-mix(in srgb, var(--primary) 22%, transparent);
}

.cal-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1;
  border-radius: 50%;
}

.cal-day.cal-today .cal-day-num {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--primary) 40%, transparent);
}

.cal-badges {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
  line-height: 1.45;
  transition:
    transform 0.12s ease,
    filter 0.12s ease;
}

.cal-badge:hover {
  transform: scale(1.04);
  filter: brightness(1.06);
}

/* 除息日 badge：綠色 */
.cal-badge-ex {
  background: color-mix(in srgb, var(--green) 14%, var(--panel));
  color: var(--green);
  border-left: 3px solid var(--green);
}

/* 除權日 badge：橘色 */
.cal-badge-right {
  background: color-mix(in srgb, var(--orange) 16%, var(--panel));
  color: var(--orange);
  border-left: 3px solid var(--orange);
}

/* 買進 badge：綠色 (使用 down 色調) */
.cal-badge-buy {
  background: color-mix(in srgb, var(--down) 14%, var(--panel));
  color: var(--down);
  border-left: 3px solid var(--down);
}

/* 再投入 badge：金色 */
.cal-badge-reinvest {
  background: color-mix(in srgb, var(--gold) 16%, var(--panel));
  color: var(--gold);
  border-left: 3px solid var(--gold);
}

/* 賣出 badge：紅色 (使用 up 色調) */
.cal-badge-sell {
  background: color-mix(in srgb, var(--up) 14%, var(--panel));
  color: var(--up);
  border-left: 3px solid var(--up);
}

/* 發放日 badge：金色漸層 */
.cal-badge-pay {
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #fff;
  border-left: 3px solid color-mix(in srgb, var(--orange) 70%, #000);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--gold) 35%, transparent);
}

/* 分割/合併 badge：大地色 */
.cal-badge-split {
  background: color-mix(in srgb, var(--earth) 14%, var(--panel));
  color: var(--earth);
  border-left: 3px solid color-mix(in srgb, var(--earth) 40%, transparent);
}

/* 補回圖例顏色的寬高，讓色塊能正常顯示 */
.cal-legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.cal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--panel-2);
}

/* ═══════════════════════════ 行事曆 RWD ═══════════════════════════ */
@media (max-width: 768px) {
  .cal-grid {
    gap: 3px;
    padding: 8px;
  }

  .cal-dow {
    font-size: 9px;
    letter-spacing: 0.04em;
    padding: 4px 1px 6px;
  }

  .cal-day {
    min-height: 58px;
    padding: 4px 3px;
  }

  .cal-day-num {
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    margin-bottom: 3px;
  }

  .cal-badges {
    gap: 2px;
  }

  .cal-badge {
    font-size: 9px;
    padding: 1px 3px;
    border-left-width: 2px;
  }
}

@media (max-width: 480px) {
  .cal-grid {
    gap: 2px;
    padding: 5px;
  }

  .cal-dow {
    font-size: 8px;
    letter-spacing: 0;
  }

  .cal-day {
    min-height: 48px;
    padding: 3px 2px;
  }

  .cal-badge {
    font-size: 8px;
    padding: 1px 2px;
  }
}

/* ═══════════════════════════ Main Tab Nav RWD ═══════════════════════════ */
@media (max-width: 768px) {
  .main-tab-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .main-tab-nav::-webkit-scrollbar {
    display: none;
  }

  .main-tab {
    padding: 10px 14px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* 交易紀錄 seg-toggle 4 tabs 橫向滑動 */
  #recordTabs {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    scrollbar-width: none;
  }

  #recordTabs::-webkit-scrollbar {
    display: none;
  }

  #recordTabs .seg {
    padding: 5px 10px;
    font-size: 11px;
  }

  /* 覆蓋 ds-right inline style：手機改 2 欄，避免 3 欄過窄 */
  .ds-right {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  /* block-header 允許換行，讓 tab 列 + 操作按鈕自然換行 */
  .block-header {
    flex-wrap: wrap;
  }
}

/* ═══════════════════════════ 超小螢幕 360px ═══════════════════════════ */
@media (max-width: 360px) {
  main {
    padding: 12px 12px 50px;
  }

  .topbar {
    padding: 10px 12px;
  }

  .brand-icon {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }

  .topbar h1 {
    font-size: 14px;
  }
}

/* ═══════════════════════════ 工具類別 (Utility Classes) ═══════════════════════════ */
.flex-ac-8 {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.flex-ac-4 {
  display: flex;
  align-items: center;
  gap: 4px;
}

.flex-8 {
  display: flex;
  gap: 8px;
}

.w-50 {
  width: 50px;
}

.th-check {
  width: 40px;
  text-align: center;
}

.td-num {
  text-align: right;
  font-weight: 600;
}

.td-sm-muted {
  font-size: 13px;
  color: var(--text-muted);
}

.clr-up-bold {
  color: var(--up);
  font-weight: 600;
}

.pg-info {
  font-size: 12px;
  min-width: 100px;
  text-align: center;
}

.fs-12 {
  font-size: 12px;
}

.mb-4 {
  margin-bottom: 4px;
}

.mr-4 {
  margin-right: 4px;
}

.btn-pg {
  padding: 4px 8px;
  font-size: 12px;
  height: auto;
}