/* ============================================================
   Fund Detail — page styles
   ============================================================ */

.breadcrumb {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--t3); white-space: nowrap; overflow: hidden;
}
.breadcrumb a { color: var(--t2); }
.breadcrumb a:hover { color: var(--a); }
.breadcrumb .sep { color: var(--t3); }
.breadcrumb .cur { color: var(--t1); overflow: hidden; text-overflow: ellipsis; }

/* HERO */
.detail-hero {
  border-bottom: 1px solid var(--b1);
  background: radial-gradient(700px 320px at 12% -40%, rgba(201,152,42,0.14), transparent 60%);
}
.detail-hero-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 28px 22px 30px;
  display: grid; grid-template-columns: minmax(0,1.5fr) minmax(280px,1fr); gap: 36px; align-items: start;
}
.fund-head { min-width: 0; }
.amc-logo {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 17px; color: #fff;
  background: linear-gradient(135deg, var(--a), var(--a2)); box-shadow: 0 3px 14px rgba(201,152,42,0.4);
}
.fund-head .top-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.fund-head h1 {
  margin: 0; font-family: var(--display); font-weight: 600; font-size: 32px;
  line-height: 1.1; letter-spacing: -0.02em; color: var(--t1); text-wrap: balance;
}
.fund-head .plan { margin: 4px 0 0; font-size: 13.5px; color: var(--t2); }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 12px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--bg3); border: 1px solid var(--b1); color: var(--t2);
}
.tag.accent { background: var(--b1); border-color: var(--b3); color: #c7d2fe; }
.tag.gold { color: var(--gold); border-color: rgba(232,184,75,0.3); background: rgba(232,184,75,0.08); }
.fund-head .desc { margin: 6px 0 0; font-size: 13.5px; color: var(--t2); line-height: 1.55; max-width: 560px; }

/* NAV card */
.nav-card {
  padding: 22px; position: relative; overflow: hidden;
}
.nav-card .nav-live {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono);
  font-size: 11px; color: var(--green); margin-bottom: 10px;
}
.nav-card .nav-label { font-size: 12px; color: var(--t3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.nav-card .nav-val { font-family: var(--mono); font-weight: 600; font-size: 36px; color: var(--t1); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1; }
.nav-card .nav-change { font-family: var(--mono); font-size: 14px; margin-top: 10px; font-weight: 500; }
.nav-card .nav-as { font-family: var(--mono); font-size: 11px; color: var(--t3); margin-top: 8px; }

/* QUICK STATS GRID */
.stat-grid {
  max-width: var(--maxw); margin: 0 auto; padding: 22px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.stat-cell { padding: 16px; }
.stat-cell .sl { font-size: 12px; color: var(--t2); text-transform: uppercase; letter-spacing: 0.06em; display: flex; align-items: center; gap: 7px; }
.stat-cell .sv { font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--t1); margin: 8px 0 4px; letter-spacing: -0.01em; }
.stat-cell .ss { font-size: 12px; color: var(--t3); }

/* TABS */
.tabs-bar {
  position: sticky; top: var(--header-h); z-index: 30;
  background: rgba(5,17,31,0.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--b1); margin-top: 6px;
}
.tabs-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; display: flex; gap: 4px; overflow-x: auto; }
.tab {
  position: relative; border: none; background: none; color: var(--t2);
  padding: 16px 16px; font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: color .16s;
}
.tab:hover { color: var(--t1); }
.tab.active { color: var(--t1); }
.tab.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--a), var(--a2)); border-radius: 2px;
}

.tab-content { max-width: var(--maxw); margin: 0 auto; padding: 26px 22px 100px; }
.panel { display: none; }
.panel.active { display: block; animation: fadeUp .35s ease both; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.section-head .hint { font-size: 12.5px; color: var(--t3); }

/* chart */
.chart-card { padding: 20px; }
.chart-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.range-seg { display: inline-flex; background: var(--bg3); border: 1px solid var(--b1); border-radius: 999px; padding: 3px; }
.range-seg button {
  border: none; background: none; color: var(--t2); padding: 6px 13px; border-radius: 999px;
  font-family: var(--mono); font-size: 12px; font-weight: 500; transition: background .15s, color .15s;
}
.range-seg button.active { background: var(--b1); color: var(--t1); border: 1px solid var(--b2); }
.bench-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--t2); margin-left: auto; }
.switch { position: relative; width: 38px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--bg3); border: 1px solid var(--b2); border-radius: 999px; transition: background .2s; }
.switch .track::before { content: ""; position: absolute; left: 3px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--t3); transition: transform .2s, background .2s; }
.switch input:checked + .track { background: rgba(232,184,75,0.18); border-color: var(--gold); }
.switch input:checked + .track::before { transform: translateX(16px); background: var(--gold); }
.chart-box { position: relative; height: 380px; }
.chart-box.sm { height: 300px; }

/* returns snapshot cards */
.snapshot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 22px; }
.snap-card { padding: 16px; }
.snap-card .sk-l { font-size: 12px; color: var(--t2); text-transform: uppercase; letter-spacing: .05em; }
.snap-card .sk-v { font-family: var(--mono); font-weight: 600; font-size: 24px; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.snap-card .sk-s { font-size: 11.5px; color: var(--t3); }
.invested-banner {
  margin-top: 16px; padding: 16px 18px; border-radius: var(--r12);
  background: linear-gradient(120deg, rgba(201,152,42,0.12), rgba(232,184,75,0.06));
  border: 1px solid var(--b2); display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.invested-banner svg { color: var(--a); flex: none; }
.invested-banner .txt { font-size: 14px; color: var(--t2); }
.invested-banner .txt b { color: var(--green); font-family: var(--mono); font-weight: 600; }

/* metric cards (risk) */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric-card { padding: 16px; }
.metric-card .ml { font-size: 12px; color: var(--t2); display: flex; align-items: center; gap: 6px; }
.metric-card .mv { font-family: var(--mono); font-weight: 600; font-size: 26px; color: var(--t1); margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.metric-card .ms { font-size: 11.5px; color: var(--t3); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
.two-col.t13 { grid-template-columns: 1.4fr 1fr; }

/* rolling returns table */
.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th { text-align: right; padding: 8px 10px; font-size: 11px; color: var(--t3); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--b1); }
.mini-table th.l { text-align: left; }
.mini-table td { text-align: right; padding: 11px 10px; font-family: var(--mono); font-size: 13px; color: var(--t1); border-bottom: 1px solid var(--b1); font-variant-numeric: tabular-nums; }
.mini-table td.l { text-align: left; font-family: var(--body); color: var(--t2); }
.mini-table tr:last-child td { border-bottom: none; }

/* risk gauge */
.gauge-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 8px 0; }
.gauge-label { font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--red); }
.gauge-sub { font-size: 12px; color: var(--t3); }

/* holdings */
.holding-row td.stock { font-family: var(--body); color: var(--t1); font-weight: 500; }
.weight-bar { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.weight-bar .bar { width: 60px; height: 6px; border-radius: 3px; background: var(--bg3); overflow: hidden; }
.weight-bar .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--a), var(--a2)); border-radius: 3px; }

.sector-bars { display: flex; flex-direction: column; gap: 12px; }
.sector-bar .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.sector-bar .top .pct { font-family: var(--mono); color: var(--t2); }
.sector-bar .track { height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.sector-bar .track i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--a), var(--a2)); }

.mcap-split { display: flex; height: 36px; border-radius: 8px; overflow: hidden; border: 1px solid var(--b1); }
.mcap-split .seg { display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; font-family: var(--mono); }

/* empty / error states */
.empty-state {
  text-align: center; padding: 56px 24px; border-radius: var(--r14);
  background:
    var(--bg3)
    repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(201,152,42,0.03) 10px, rgba(201,152,42,0.03) 20px);
  border: 1px solid var(--b1);
}
.empty-state .ico { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 14px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--b2); color: var(--a); }
.empty-state h4 { margin: 0 0 8px; font-family: var(--display); font-size: 18px; font-weight: 600; color: var(--t1); }
.empty-state p { margin: 0 auto; max-width: 380px; font-size: 13.5px; color: var(--t2); line-height: 1.55; }
.error-state .ico { color: var(--red); }

/* FAB */
.fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 60;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 20px; border: none; border-radius: 999px; color: #fff;
  font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, var(--a), var(--a2));
  box-shadow: var(--shadow-cta);
  transition: transform .16s, box-shadow .16s;
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(201,152,42,0.55); }

/* loading skeleton overlay */
.detail-skeleton { padding: 0; }
.sk-line { height: 14px; margin: 8px 0; }

/* RESPONSIVE */
@media (max-width: 1000px) {
  .detail-hero-inner { grid-template-columns: 1fr; gap: 22px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .snapshot-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col, .two-col.t13 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .header-center { display: none; }
  .fund-head h1 { font-size: 26px; }
  .nav-card .nav-val { font-size: 30px; }
  .chart-box { height: 300px; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .snapshot-grid { grid-template-columns: 1fr 1fr; }
  .fab { right: 14px; bottom: 14px; padding: 12px 16px; }
}
