/* BTI PULSE Performance Center v1 — scoped extension for the existing PULSE design */
#bti-app .performance-center{display:grid;gap:16px}
#bti-app .performance-toolbar{padding:16px 18px;margin-bottom:0}
#bti-app .performance-toolbar .table-tools{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr)) auto;gap:10px;align-items:end;margin:0}
#bti-app .performance-filter{display:grid;gap:6px}
#bti-app .performance-filter label{font-size:9px;font-weight:760;letter-spacing:.1em;text-transform:uppercase;color:#718393}
#bti-app .performance-filter-summary{display:flex;align-items:center;justify-content:flex-end;min-height:39px;white-space:nowrap}
#bti-app .performance-filter-summary .pill{padding:7px 10px;border:1px solid rgba(98,180,255,.17);background:rgba(98,180,255,.055);color:#a9c9df}

#bti-app .performance-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
#bti-app .performance-kpi{min-height:126px;padding:18px;border:1px solid rgba(117,145,166,.2);border-radius:17px;background:linear-gradient(145deg,rgba(15,22,29,.97),rgba(9,15,20,.95));box-shadow:0 16px 46px rgba(0,0,0,.16),inset 0 1px rgba(255,255,255,.025);position:relative;overflow:hidden}
#bti-app .performance-kpi:before{content:"";position:absolute;inset:0 0 auto;height:2px;background:linear-gradient(90deg,transparent,rgba(98,180,255,.85),transparent)}
#bti-app .performance-kpi:nth-child(3):before{background:linear-gradient(90deg,transparent,rgba(67,209,122,.88),transparent)}
#bti-app .performance-kpi:nth-child(4):before{background:linear-gradient(90deg,transparent,rgba(215,170,85,.86),transparent)}
#bti-app .performance-kpi-label{font-size:10px;font-weight:760;letter-spacing:.09em;text-transform:uppercase;color:#8da0af;margin-bottom:12px}
#bti-app .performance-kpi-value{font-size:28px;line-height:1;font-weight:750;letter-spacing:-.045em;color:#f4f8fc}
#bti-app .performance-kpi-foot{margin-top:10px;font-size:10px;color:#6f8190;display:flex;gap:7px;align-items:center;min-height:16px}
#bti-app .performance-kpi-foot:before{content:"";width:5px;height:5px;border-radius:50%;background:#5f7b91;box-shadow:0 0 10px rgba(98,180,255,.25)}
#bti-app .performance-kpi.positive-state .performance-kpi-value{color:#49dd84}
#bti-app .performance-kpi.negative-state .performance-kpi-value{color:#ff6c69}

#bti-app .performance-chart-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(320px,.85fr);gap:16px}
#bti-app .performance-chart-card{margin:0;min-height:390px}
#bti-app .performance-chart-card .panel-head{margin-bottom:14px}
#bti-app .performance-chart-card .chart{height:292px}
#bti-app .performance-chart-card.performance-daily-card{min-height:360px}
#bti-app .performance-donut-wrap{min-height:292px;display:grid;grid-template-columns:minmax(168px,210px) minmax(0,1fr);align-items:center;gap:22px;padding:8px 2px 2px}
#bti-app .performance-donut{width:min(190px,100%);aspect-ratio:1;border-radius:50%;position:relative;margin:auto;background:conic-gradient(rgba(98,180,255,.16) 0 100%);box-shadow:0 0 0 1px rgba(255,255,255,.035),0 20px 50px rgba(0,0,0,.22)}
#bti-app .performance-donut:after{content:"";position:absolute;inset:25%;border-radius:50%;background:linear-gradient(145deg,#0c1319,#080d12);border:1px solid rgba(255,255,255,.055);box-shadow:inset 0 10px 28px rgba(0,0,0,.4)}
#bti-app .performance-donut-center{position:absolute;inset:0;z-index:1;display:grid;place-content:center;text-align:center;pointer-events:none}
#bti-app .performance-donut-center strong{font-size:28px;line-height:1;font-weight:760;letter-spacing:-.045em;color:#f3f8fc}
#bti-app .performance-donut-center span{font-size:9px;text-transform:uppercase;letter-spacing:.12em;color:#718595;margin-top:7px}
#bti-app .performance-legend{display:grid;gap:8px;align-content:center;min-width:0}
#bti-app .performance-legend-item{width:100%;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:9px;align-items:center;padding:8px 9px;border:1px solid transparent;border-radius:10px;background:transparent;color:#dce7ef;text-align:left;cursor:default}
#bti-app button.performance-legend-item{cursor:pointer}
#bti-app button.performance-legend-item:hover{border-color:rgba(98,180,255,.2);background:rgba(98,180,255,.045)}
#bti-app .performance-legend-dot{width:8px;height:8px;border-radius:3px;box-shadow:0 0 12px currentColor}
#bti-app .performance-legend-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:#aebdca}
#bti-app .performance-legend-value{font-size:11px;font-weight:700;color:#eef5fa}
#bti-app .performance-empty{height:100%;min-height:250px;display:grid;place-items:center;text-align:center;color:#6f8291;font-size:12px;padding:28px}

#bti-app .performance-daily-chart{height:285px;overflow-x:auto;overflow-y:hidden;padding-bottom:5px}
#bti-app .performance-daily-chart svg{display:block;height:270px;overflow:visible}
#bti-app .performance-daily-grid{stroke:rgba(128,154,174,.13);stroke-width:1}
#bti-app .performance-daily-zero{stroke:rgba(210,225,237,.34);stroke-width:1.15}
#bti-app .performance-daily-axis{fill:#6f8291;font-size:9px}
#bti-app .performance-daily-label{fill:#718493;font-size:8.5px}
#bti-app .performance-daily-bar-positive{fill:#39c978}
#bti-app .performance-daily-bar-negative{fill:#f35d5a}
#bti-app .performance-daily-bar-neutral{fill:#d6a94f}
#bti-app .performance-daily-value{fill:#dbe7ef;font-size:8px;font-weight:700}
#bti-app .performance-chart-note{display:flex;gap:12px;align-items:center;flex-wrap:wrap;color:#718493;font-size:9px}
#bti-app .performance-chart-note span{display:inline-flex;align-items:center;gap:6px}
#bti-app .performance-chart-note i{width:7px;height:7px;border-radius:2px;display:inline-block}

#bti-app .performance-secondary-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:3px 1px -2px}
#bti-app .performance-secondary-title h2{font-size:13px;color:#b7c5cf}
#bti-app .performance-secondary-title span{font-size:10px;color:#637686}

@media(max-width:1180px){
  #bti-app .performance-toolbar .table-tools{grid-template-columns:repeat(3,minmax(150px,1fr))}
  #bti-app .performance-filter-summary{justify-content:flex-start}
  #bti-app .performance-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  #bti-app .performance-chart-grid{grid-template-columns:1fr}
  #bti-app .performance-chart-card{min-height:auto}
}
@media(max-width:720px){
  #bti-app .performance-toolbar .table-tools{grid-template-columns:1fr 1fr}
  #bti-app .performance-filter-summary{grid-column:1/-1}
  #bti-app .performance-donut-wrap{grid-template-columns:1fr;gap:12px}
  #bti-app .performance-donut{width:168px}
  #bti-app .performance-legend{grid-template-columns:1fr 1fr}
  #bti-app .performance-chart-card .chart{height:270px}
}
@media(max-width:500px){
  #bti-app .performance-toolbar .table-tools{grid-template-columns:1fr}
  #bti-app .performance-kpis{grid-template-columns:1fr 1fr;gap:10px}
  #bti-app .performance-kpi{min-height:112px;padding:15px}
  #bti-app .performance-kpi-value{font-size:23px}
  #bti-app .performance-legend{grid-template-columns:1fr}
}
@media(max-width:360px){#bti-app .performance-kpis{grid-template-columns:1fr}}

/* BTI PULSE Performance Center v1.1 — unit sync, layout polish, settings move */
#bti-app .performance-toolbar-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding-bottom:15px;margin-bottom:15px;border-bottom:1px solid rgba(117,145,166,.13)}
#bti-app .performance-toolbar-head h2{font-size:18px;margin:2px 0 3px;color:#eef5fa}
#bti-app .performance-global-unit{display:flex;align-items:center;gap:11px;flex:0 0 auto}
#bti-app .performance-global-unit>span{font-size:9px;font-weight:760;letter-spacing:.1em;text-transform:uppercase;color:#718393}
#bti-app .performance-global-unit .chart-toggle{min-width:162px}
#bti-app .performance-toolbar .table-tools{grid-template-columns:repeat(5,minmax(140px,1fr)) auto}

/* The fixed equity component is taller than the original placeholder. Never clip its footer cards. */
#bti-app .performance-chart-grid>.performance-chart-card:first-child{min-height:610px;overflow:visible}
#bti-app .performance-chart-card .chart{height:auto!important;min-height:505px!important;overflow:visible!important;padding-bottom:4px}
#bti-app .performance-chart-card .chart-shell{height:auto!important}
#bti-app .performance-chart-card .chart-footer.four{position:relative;z-index:2;margin-top:14px!important}

/* Balanced donut layout. */
#bti-app .performance-donut-wrap{justify-content:center}
#bti-app .performance-donut-wrap.single-segment{grid-template-columns:1fr;justify-items:center;align-content:center;gap:14px;padding-top:18px}
#bti-app .performance-donut-wrap.single-segment .performance-donut{width:210px}
#bti-app .performance-donut-wrap.single-segment .performance-legend{width:min(430px,100%)}
#bti-app .performance-donut-wrap.single-segment .performance-legend-item{grid-template-columns:auto minmax(0,1fr) auto;background:rgba(255,255,255,.018);border-color:rgba(117,145,166,.10)}
#bti-app .performance-donut-wrap.single-segment .performance-legend-name{text-align:center}

#bti-app #cashflow-settings-panel{margin-top:14px}
#bti-app #cashflow-settings-panel .cashflow-form{margin-top:4px}

@media(max-width:1180px){
  #bti-app .performance-toolbar .table-tools{grid-template-columns:repeat(3,minmax(150px,1fr))}
  #bti-app .performance-chart-grid>.performance-chart-card:first-child{min-height:auto}
}
@media(max-width:720px){
  #bti-app .performance-toolbar-head{display:grid;grid-template-columns:1fr;gap:12px}
  #bti-app .performance-global-unit{justify-content:space-between;width:100%}
  #bti-app .performance-global-unit .chart-toggle{flex:1;max-width:230px}
  #bti-app .performance-chart-card .chart{min-height:430px!important;overflow:hidden!important}
  #bti-app .performance-donut-wrap.single-segment .performance-donut{width:176px}
}


/* BTI PULSE Performance Center v1.2 — advanced breakdown charts */
#bti-app .performance-breakdown-title{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin:7px 2px 0;padding:4px 1px 2px}
#bti-app .performance-breakdown-title h2{font-size:17px;margin:3px 0 4px;color:#eef5fa}
#bti-app .performance-breakdown-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
#bti-app .performance-breakdown-card{margin:0;min-width:0;min-height:390px;overflow:hidden}
#bti-app .performance-breakdown-card .panel-head{align-items:flex-start;margin-bottom:8px}
#bti-app .performance-breakdown-card .panel-head h2{font-size:14px}
#bti-app .performance-month-card{grid-column:1/-1;min-height:410px}
#bti-app .performance-year-control{display:grid;gap:5px;min-width:110px}
#bti-app .performance-year-control label{font-size:9px;font-weight:760;letter-spacing:.1em;text-transform:uppercase;color:#718393}
#bti-app .performance-breakdown-chart{height:315px;overflow-x:auto;overflow-y:hidden;padding:2px 0 3px;scrollbar-width:thin;scrollbar-color:rgba(98,180,255,.24) transparent}
#bti-app .performance-breakdown-chart svg{display:block;height:300px;overflow:visible}
#bti-app .performance-breakdown-gridline{stroke:rgba(128,154,174,.13);stroke-width:1}
#bti-app .performance-breakdown-zero{stroke:rgba(210,225,237,.38);stroke-width:1.2}
#bti-app .performance-breakdown-axis{fill:#6f8291;font-size:8.5px}
#bti-app .performance-breakdown-label{fill:#9eafbc;font-size:9px;font-weight:680}
#bti-app .performance-breakdown-count{fill:#5f7281;font-size:7.5px}
#bti-app .performance-breakdown-value{fill:#dbe7ef;font-size:8px;font-weight:760}
#bti-app .performance-breakdown-positive{fill:#39c978;filter:drop-shadow(0 4px 8px rgba(57,201,120,.13))}
#bti-app .performance-breakdown-negative{fill:#f35d5a;filter:drop-shadow(0 4px 8px rgba(243,93,90,.12))}
#bti-app .performance-breakdown-neutral{fill:#d6a94f}
#bti-app .performance-breakdown-bar:hover rect{filter:brightness(1.15) drop-shadow(0 5px 12px rgba(98,180,255,.14))}

@media(max-width:900px){
  #bti-app .performance-breakdown-grid{grid-template-columns:1fr}
  #bti-app .performance-month-card{grid-column:auto}
  #bti-app .performance-breakdown-title{align-items:flex-start;flex-direction:column}
}
@media(max-width:600px){
  #bti-app .performance-breakdown-card{min-height:365px}
  #bti-app .performance-breakdown-card .panel-head{display:grid;gap:10px}
  #bti-app .performance-year-control{width:100%}
  #bti-app .performance-breakdown-chart{height:300px}
  #bti-app .performance-breakdown-chart svg{height:286px}
}

/* BTI PULSE Performance Center v1.3 — hierarchy, readability and insight polish */
#bti-app .performance-center{gap:18px}
#bti-app .performance-accent-card,
#bti-app .performance-calendar-card,
#bti-app .performance-detail-grid>.panel,
#bti-app .performance-detail-metrics>.metric{position:relative;border-color:rgba(69,153,219,.25)!important;box-shadow:0 18px 48px rgba(0,0,0,.18),inset 0 1px rgba(255,255,255,.025),0 0 0 1px rgba(36,126,197,.025)}
#bti-app .performance-accent-card:before,
#bti-app .performance-calendar-card:before,
#bti-app .performance-detail-grid>.panel:before,
#bti-app .performance-detail-metrics>.metric:before{content:"";position:absolute;left:16px;right:16px;top:-1px;height:2px;border-radius:999px;background:linear-gradient(90deg,transparent,rgba(57,157,233,.82),rgba(100,195,255,.28),transparent);pointer-events:none}
#bti-app .performance-accent-card:hover{border-color:rgba(77,170,238,.34)!important}

/* KPI microcopy must remain readable on large desktop screens. */
#bti-app .performance-kpi{min-height:132px;padding:19px 20px}
#bti-app .performance-kpi-label{font-size:11px;color:#9cafbd}
#bti-app .performance-kpi-foot{margin-top:12px;font-size:12px;line-height:1.35;color:#98aab7;min-height:18px}
#bti-app .performance-kpi-foot:before{width:6px;height:6px;background:#6e9bb9}

/* Main hierarchy. */
#bti-app .performance-main-grid{grid-template-columns:minmax(0,1.62fr) minmax(340px,.88fr)}
#bti-app .performance-main-grid>.performance-chart-card:first-child{min-height:590px}
#bti-app .performance-main-grid>.performance-chart-card:last-child{min-height:590px}
#bti-app .performance-secondary-grid{grid-template-columns:minmax(0,1.55fr) minmax(340px,.85fr)}
#bti-app .performance-secondary-grid>.performance-chart-card:first-child{min-height:390px!important;overflow:hidden}
#bti-app .performance-secondary-grid .performance-daily-chart{min-height:300px}
#bti-app .performance-secondary-grid .performance-donut-wrap{min-height:300px}
#bti-app .performance-center .panel-head .muted{font-size:12.5px;line-height:1.4;color:#91a4b2}

/* Calendar becomes a featured early section. */
#bti-app .performance-calendar-card{margin:0;overflow:hidden;background:linear-gradient(145deg,rgba(13,22,31,.98),rgba(8,14,20,.97))}
#bti-app .performance-calendar-card .panel-head{padding-bottom:14px;margin-bottom:16px;border-bottom:1px solid rgba(113,149,177,.14)}
#bti-app .performance-calendar-card .calendar-summary-pill{font-size:12px}
#bti-app .performance-calendar-card .calendar-month{font-size:13px;font-weight:750}
#bti-app .performance-calendar-card .calendar-day{min-height:98px}
#bti-app .performance-calendar-card .calendar-date{font-size:12px}
#bti-app .performance-calendar-card .calendar-result{font-size:17px}

/* Quick insight strip breaks up the repeated chart rhythm. */
#bti-app .performance-insight-section{display:grid;gap:10px}
#bti-app .performance-section-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;padding:0 2px}
#bti-app .performance-section-heading h2{font-size:17px;margin:3px 0 0;color:#eef7fd}
#bti-app .performance-section-heading>span{font-size:11.5px;color:#7f93a2}
#bti-app .performance-insights{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
#bti-app .performance-insight-card{min-height:132px;padding:17px 18px;border:1px solid rgba(81,151,202,.22);border-radius:16px;background:linear-gradient(145deg,rgba(15,24,32,.98),rgba(9,15,21,.97));box-shadow:0 15px 40px rgba(0,0,0,.16);position:relative;overflow:hidden}
#bti-app .performance-insight-card:before{content:"";position:absolute;left:0;right:0;top:0;height:2px;background:linear-gradient(90deg,transparent,rgba(76,168,235,.8),transparent)}
#bti-app .performance-insight-card.positive{border-color:rgba(57,201,120,.28)}
#bti-app .performance-insight-card.positive:before{background:linear-gradient(90deg,transparent,rgba(57,201,120,.92),transparent)}
#bti-app .performance-insight-card.negative{border-color:rgba(243,93,90,.28)}
#bti-app .performance-insight-card.negative:before{background:linear-gradient(90deg,transparent,rgba(243,93,90,.92),transparent)}
#bti-app .performance-insight-card.warning{border-color:rgba(214,169,79,.28)}
#bti-app .performance-insight-card.warning:before{background:linear-gradient(90deg,transparent,rgba(214,169,79,.92),transparent)}
#bti-app .performance-insight-label{font-size:10px;font-weight:780;letter-spacing:.1em;text-transform:uppercase;color:#7f94a4}
#bti-app .performance-insight-name{margin-top:12px;font-size:13px;font-weight:720;color:#d9e6ef;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#bti-app .performance-insight-value{margin-top:5px;font-size:24px;line-height:1;font-weight:800;letter-spacing:-.035em;color:#edf6fc}
#bti-app .performance-insight-value.positive{color:#45d582}
#bti-app .performance-insight-value.negative{color:#ff6a67}
#bti-app .performance-insight-foot{margin-top:9px;font-size:11.5px;color:#8599a8}

/* Larger chart typography and cleaner legends. */
#bti-app .performance-chart-note{font-size:11px;color:#9badb9;gap:15px}
#bti-app .performance-chart-note i{width:8px;height:8px}
#bti-app .performance-daily-chart{height:315px;padding:2px 0 7px}
#bti-app .performance-daily-chart svg{height:292px}
#bti-app .performance-daily-axis{font-size:11px;fill:#91a4b1}
#bti-app .performance-daily-label{font-size:11px;fill:#9eafbb;font-weight:620}
#bti-app .performance-daily-value{font-size:10.5px;fill:#edf5fa;font-weight:800}
#bti-app .performance-donut-center strong{font-size:30px}
#bti-app .performance-donut-center span{font-size:10px;color:#8295a4}
#bti-app .performance-legend-name{font-size:12.5px;color:#b8c8d3}
#bti-app .performance-legend-value{font-size:12.5px}
#bti-app .performance-legend-item{padding:10px 11px}
#bti-app .performance-donut-wrap.single-segment{min-height:470px;align-content:center}
#bti-app .performance-donut-wrap.single-segment .performance-donut{width:224px}
#bti-app .performance-donut-wrap.single-segment .performance-legend{width:min(470px,92%)}

/* Breakdown charts use the entire card width and readable labels. */
#bti-app .performance-breakdown-title{margin-top:8px}
#bti-app .performance-breakdown-title h2{font-size:19px}
#bti-app .performance-breakdown-title .muted{font-size:12.5px}
#bti-app .performance-breakdown-card{min-height:420px}
#bti-app .performance-breakdown-card .panel-head h2{font-size:15.5px}
#bti-app .performance-month-card{min-height:440px}
#bti-app .performance-breakdown-chart{width:100%;height:345px;overflow-x:hidden;padding:4px 0 6px}
#bti-app .performance-breakdown-chart svg{width:100%;height:322px}
#bti-app .performance-breakdown-axis{fill:#91a4b1;font-size:10.5px}
#bti-app .performance-breakdown-label{fill:#b0c0cb;font-size:11.5px;font-weight:720}
#bti-app .performance-breakdown-count{fill:#778b9a;font-size:9.5px}
#bti-app .performance-breakdown-value{fill:#eef6fb;font-size:10.5px;font-weight:820}
#bti-app .performance-year-control label{font-size:10px;color:#8fa2b1}
#bti-app .performance-month-card .performance-breakdown-chart{height:360px}
#bti-app .performance-month-card .performance-breakdown-chart svg{height:338px}

/* Detailed stats remain useful but visually compact. */
#bti-app .performance-secondary-title{margin-top:6px;padding-top:2px}
#bti-app .performance-secondary-title h2{font-size:15px;color:#d4e1ea}
#bti-app .performance-secondary-title span{font-size:11.5px;color:#8295a4}
#bti-app .performance-detail-metrics{gap:12px}
#bti-app .performance-detail-metrics>.metric{min-height:112px;padding:16px 17px}
#bti-app .performance-detail-metrics .metric-label{font-size:11px}
#bti-app .performance-detail-metrics .metric-foot{font-size:11.5px;color:#91a2ae}
#bti-app .performance-detail-grid .rule{font-size:12.5px}

@media(max-width:1180px){
  #bti-app .performance-main-grid,#bti-app .performance-secondary-grid{grid-template-columns:1fr}
  #bti-app .performance-main-grid>.performance-chart-card:first-child,#bti-app .performance-main-grid>.performance-chart-card:last-child{min-height:auto}
  #bti-app .performance-insights{grid-template-columns:repeat(2,minmax(0,1fr))}
  #bti-app .performance-donut-wrap.single-segment{min-height:330px}
}
@media(max-width:720px){
  #bti-app .performance-kpi-foot{font-size:11px}
  #bti-app .performance-insights{grid-template-columns:1fr 1fr;gap:10px}
  #bti-app .performance-insight-card{min-height:120px;padding:15px}
  #bti-app .performance-insight-value{font-size:21px}
  #bti-app .performance-section-heading{align-items:flex-start;flex-direction:column;gap:3px}
  #bti-app .performance-breakdown-chart{overflow-x:auto}
  #bti-app .performance-breakdown-chart svg{min-width:680px}
  #bti-app .performance-month-card .performance-breakdown-chart svg{min-width:930px}
}
@media(max-width:480px){
  #bti-app .performance-insights{grid-template-columns:1fr}
  #bti-app .performance-calendar-card .calendar-day{min-height:88px}
}
