/* FIPI / LIPI Smart Money Dashboard — KseAlert website */

body.kse-fipi-lipi-page {
  background: #f4f7fb;
}

.kse-fipi-lipi-page .site-main {
  padding-bottom: 48px;
}

.fld-root {
  min-height: 320px;
}

.fld-loading,
.fld-empty {
  padding: 48px 16px;
  text-align: center;
  color: #64748b;
  font-size: 15px;
}

/* Toolbar */
.fld-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.fld-flow-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: #e8eef5;
  border-radius: 10px;
}

.fld-flow-tab {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
}

.fld-flow-tab.is-active {
  background: #fff;
  color: #0a2540;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.fld-date-label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fld-date-select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  background: #fff;
}

.fld-mock-badge {
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 4px 10px;
  border-radius: 999px;
}

/* Summary cards */
.fld-summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.fld-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.fld-stat-smart { border-top: 3px solid #059669; }
.fld-stat-retail { border-top: 3px solid #dc2626; }
.fld-stat-sector { border-top: 3px solid #2563eb; }

.fld-stat-k {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 6px;
}

.fld-stat-v {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.fld-stat-sector .fld-stat-v {
  font-size: 17px;
}

.fld-stat-sub {
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}

/* 60 / 40 split */
.fld-split {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 18px;
  align-items: start;
}

.fld-heatmap-panel,
.fld-chart-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.fld-panel-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.fld-panel-desc {
  margin: 0 0 14px;
  font-size: 12px;
  color: #64748b;
}

/* Heatmap table */
.fld-heatmap-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.fld-heatmap {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 12px;
}

.fld-heatmap thead th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  padding: 10px 8px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid #e2e8f0;
}

.fld-heatmap thead th.fld-sticky-col {
  text-align: left;
  left: 0;
  z-index: 3;
}

.fld-sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  min-width: 140px;
  max-width: 160px;
  text-align: left;
  box-shadow: 2px 0 6px rgba(15, 23, 42, 0.06);
}

.fld-heatmap tbody th.fld-sticky-col {
  background: #fafbfc;
  vertical-align: top;
  padding: 10px 10px;
  border-bottom: 1px solid #e2e8f0;
}

.fld-sector-name {
  display: block;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
  line-height: 1.25;
}

.fld-sector-net {
  font-size: 11px;
  font-weight: 700;
}

.fld-heatmap td {
  padding: 10px 8px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}

.fld-sector-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.fld-sector-row:hover {
  background: #f8fafc;
}

.fld-sector-row.is-selected th.fld-sticky-col,
.fld-sector-row.is-selected td {
  outline: 2px solid #93c5fd;
  outline-offset: -2px;
}

/* Chart */
.fld-chart-wrap {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 8px 4px 4px;
}

.fld-chart-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: #0f172a;
  color: #f8fafc;
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
}

.fld-chart-tooltip strong {
  color: #fff;
}

/* Responsive */
@media (max-width: 1024px) {
  .fld-split {
    grid-template-columns: 1fr;
  }

  .fld-summary-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .fld-stat-v {
    font-size: 18px;
  }

  .fld-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .fld-flow-tabs {
    width: 100%;
  }

  .fld-flow-tab {
    flex: 1;
  }
}
