/* MF Performance Dashboard v2 */
.mfpd { font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; color:#111; max-width:880px; margin:0 auto 2rem; }
.mfpd *{box-sizing:border-box;}
.mfpd-hidden{display:none!important;}

/* Search */
.mfpd-search-wrap{position:relative;margin-bottom:20px;}
.mfpd-search-box{display:flex;align-items:center;border:1.5px solid #d0cfc9;border-radius:10px;background:#fff;padding:0 12px;transition:border-color .15s;}
.mfpd-search-box:focus-within{border-color:#2a78d6;}
.mfpd-search-icon{font-size:16px;margin-right:8px;color:#888;}
.mfpd-search-input{flex:1;border:none;outline:none;font-size:15px;padding:12px 0;background:transparent;color:#111;font-family:inherit;}
.mfpd-search-input::placeholder{color:#aaa;}
.mfpd-clear{background:none;border:none;cursor:pointer;color:#aaa;font-size:16px;padding:4px 6px;line-height:1;display:none;}
.mfpd-clear.visible{display:block;}

/* Autocomplete */
.mfpd-suggestions{position:absolute;top:calc(100% + 4px);left:0;right:0;background:#fff;border:1px solid #e0dfd9;border-radius:10px;list-style:none;margin:0;padding:6px 0;z-index:9999;max-height:280px;overflow-y:auto;display:none;}
.mfpd-suggestions.open{display:block;}
.mfpd-suggestions li{padding:10px 16px;cursor:pointer;font-size:13px;color:#222;line-height:1.4;}
.mfpd-suggestions li:hover,.mfpd-suggestions li.active{background:#f0f5fc;color:#2a78d6;}
.mfpd-suggestions li em{display:block;font-style:normal;font-size:11px;color:#888;margin-top:2px;}

/* States */
.mfpd-state{text-align:center;padding:48px 20px;}
.mfpd-state-icon{font-size:40px;margin-bottom:12px;}
.mfpd-state-title{font-size:17px;font-weight:600;color:#111;margin-bottom:8px;}
.mfpd-state-desc{font-size:13px;color:#666;max-width:440px;margin:0 auto;}
.mfpd-spinner{width:36px;height:36px;border:3px solid #e0dfd9;border-top-color:#2a78d6;border-radius:50%;animation:mfpd-spin .7s linear infinite;margin:0 auto 12px;}
@keyframes mfpd-spin{to{transform:rotate(360deg);}}

/* Popular chips */
.mfpd-popular-wrap{margin-top:24px;}
.mfpd-popular-label{font-size:12px;color:#888;margin-bottom:10px;text-transform:uppercase;letter-spacing:.5px;}
.mfpd-popular-chips{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;}
.mfpd-chip{background:#f0f5fc;border:1px solid #c6d9f5;border-radius:20px;padding:6px 14px;font-size:12px;color:#2a78d6;cursor:pointer;font-family:inherit;transition:all .15s;}
.mfpd-chip:hover{background:#2a78d6;color:#fff;border-color:#2a78d6;}

/* Fund header */
.mfpd-dashboard{border:1px solid #e0dfd9;border-radius:12px;overflow:hidden;background:#fff;}
.mfpd-fund-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:18px 20px;border-bottom:1px solid #e0dfd9;background:#fafaf8;flex-wrap:wrap;}
.mfpd-fund-name{font-size:16px;font-weight:600;color:#0b0b0b;margin-bottom:6px;line-height:1.3;}
.mfpd-fund-sub{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.mfpd-badge{font-size:11px;font-weight:500;background:#e6f1fb;color:#185fa5;padding:3px 10px;border-radius:20px;}
.mfpd-fund-house{font-size:12px;color:#666;}
.mfpd-nav-box{text-align:right;flex-shrink:0;}
.mfpd-nav-label{font-size:11px;color:#888;text-transform:uppercase;letter-spacing:.4px;margin-bottom:2px;}
.mfpd-nav-value{font-size:26px;font-weight:700;color:#0b0b0b;}
.mfpd-nav-date{font-size:11px;color:#888;margin-top:2px;}

/* Metrics */
.mfpd-metrics{display:flex;flex-wrap:wrap;border-bottom:1px solid #e0dfd9;}
.mfpd-met{flex:1 1 90px;padding:14px 10px;text-align:center;border-right:1px solid #e0dfd9;}
.mfpd-met:last-child{border-right:none;}
.mfpd-met-label{font-size:10px;color:#888;text-transform:uppercase;letter-spacing:.4px;margin-bottom:4px;}
.mfpd-met-val{font-size:17px;font-weight:700;color:#0b0b0b;}
.mfpd-met-val.pos{color:#0c6e44;}
.mfpd-met-val.neg{color:#c0392b;}

/* Tabs */
.mfpd-tabs{display:flex;flex-wrap:wrap;border-bottom:1px solid #e0dfd9;background:#fafaf8;padding:0 12px;}
.mfpd-tab{background:none;border:none;border-bottom:2px solid transparent;padding:10px 14px;font-size:13px;color:#555;cursor:pointer;font-family:inherit;margin-bottom:-1px;transition:color .15s,border-color .15s;}
.mfpd-tab:hover{color:#0b0b0b;}
.mfpd-tab-active{color:#2a78d6!important;border-bottom-color:#2a78d6!important;font-weight:500;}

/* Panels */
.mfpd-panel-wrap{padding:20px;}
.mfpd-chart-wrap{position:relative;width:100%;}

/* Period bar */
.mfpd-period-bar{display:flex;gap:4px;margin-bottom:14px;}
.mfpd-period{background:none;border:1px solid #e0dfd9;border-radius:6px;padding:4px 12px;font-size:12px;color:#555;cursor:pointer;font-family:inherit;transition:all .15s;}
.mfpd-period:hover{background:#f0f5fc;border-color:#b0c8ef;}
.mfpd-period-active{background:#2a78d6!important;border-color:#2a78d6!important;color:#fff!important;}

/* Legend */
.mfpd-legend{display:flex;gap:16px;margin-bottom:12px;font-size:12px;color:#555;flex-wrap:wrap;}
.mfpd-leg{display:flex;align-items:center;gap:6px;}
.mfpd-leg-dot{width:10px;height:10px;border-radius:2px;flex-shrink:0;}

/* Risk grid */
.mfpd-risk-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px;}
.mfpd-risk-card{background:#fafaf8;border:1px solid #e0dfd9;border-radius:8px;padding:12px 14px;}
.mfpd-risk-card-label{font-size:10px;color:#888;text-transform:uppercase;letter-spacing:.4px;margin-bottom:4px;}
.mfpd-risk-card-val{font-size:20px;font-weight:700;color:#0b0b0b;margin-bottom:4px;}
.mfpd-risk-card-val.pos{color:#0c6e44;}
.mfpd-risk-card-desc{font-size:11px;color:#888;line-height:1.4;}

/* SIP */
.mfpd-sip-controls{display:flex;flex-wrap:wrap;gap:20px;background:#fafaf8;border:1px solid #e0dfd9;border-radius:8px;padding:14px 16px;margin-bottom:16px;}
.mfpd-sip-controls label{display:flex;flex-direction:column;gap:6px;flex:1;min-width:180px;font-size:13px;color:#555;}
.mfpd-sip-controls input[type=range]{width:100%;accent-color:#2a78d6;}
.mfpd-sip-controls strong{color:#0b0b0b;}
.mfpd-sip-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px;margin-bottom:16px;}
.mfpd-sip-stat{background:#fafaf8;border:1px solid #e0dfd9;border-radius:8px;padding:10px 12px;}
.mfpd-sip-stat-label{font-size:10px;color:#888;text-transform:uppercase;letter-spacing:.4px;margin-bottom:4px;}
.mfpd-sip-stat-val{font-size:15px;font-weight:700;color:#0b0b0b;}
.mfpd-sip-stat-val.pos{color:#0c6e44;}

@media(max-width:600px){
  .mfpd-met{min-width:80px;}
  .mfpd-tab{padding:8px 10px;font-size:12px;}
  .mfpd-fund-name{font-size:14px;}
  .mfpd-nav-value{font-size:20px;}
}
