.iv-page {
  background: #f4f6fa;
  padding: 40px 24px 64px;
}

.iv-hero {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 28px;
}

.iv-hero h1 {
  font-size: 40px;
  font-weight: 800;
  margin: 0 0 8px;
  color: #111827;
}

.iv-hero p {
  font-size: 15px;
  color: #5a6472;
  margin: 0;
}

/* ================= Category filter tabs ================= */
.iv-tabs-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0 auto 32px;
  position: relative;
  z-index: 200;
}
.iv-tabs-wrap::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -28px;
  right: -28px;
  bottom: -5px;
  background: radial-gradient(
    ellipse 70% 100% at center,
    rgba(244, 246, 250, 1) 0%,
    rgba(245, 246, 250, 0.75) 45%,
    rgba(245, 246, 250, 0) 100%
  );
  z-index: -1;
  pointer-events: none;
}
.iv-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: #ffffff;
  border-radius: 0.75rem;   
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  padding: 0.5rem;          
  width: fit-content;
  max-width: 100%;
}
@media (max-width: 768px) {
  .iv-tabs-wrap::before {
    display: none;
  }
  .iv-tabs-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, transparent, #ffffff);
    border-radius: 0 0.75rem 0.75rem 0;
    pointer-events: none;
    z-index: 5;
  }
}
.iv-tabs-bar .iv-tab {
  flex: 0 0 auto;
  cursor: pointer;
  border: none;
  border-radius: 0.5rem;
  background-color: transparent;
  padding-inline: 1rem;     
  padding-block: 0.5rem;    
  font-weight: 600;
  font-size: 14px;          
  white-space: nowrap;
  color: #000000;
  transition: all 300ms ease;
}

.iv-tabs-bar .iv-tab:hover {
  background-color: transparent;
  color: #4f46e5;
}

.iv-tabs-bar .iv-tab.active {
  background: var(--gradient-button-primary, linear-gradient(135deg, #6366f1, #4f46e5));
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.iv-tabs-bar .iv-tab.active:hover {
  background: var(--gradient-button-primary-hover, linear-gradient(135deg, #6366f1, #4f46e5));
}

.iv-toggle {
  display: inline-flex;
  background: #f1f3f7;
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 0;
  max-width: 100%;
  overflow-x: auto;
}

.iv-toggle span {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
}

.iv-toggle span.is-active {
  background: #ffffff;
  color: #1c2430;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.iv-two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 20px;
  width: 100%;
  margin: 0 auto 24px;
}

.iv-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "title    toggle"
    "subtitle subtitle"
    "body     body";
  column-gap: 12px;
  background: #ffffff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(20, 30, 60, 0.06);
  min-width: 0;
}

.iv-card h2 {
  grid-area: title;
  align-self: center;
  font-size: 19px;
  margin: 0;
  color: #111827;
}

.iv-card .iv-subtitle {
  grid-area: subtitle;
  font-size: 13px;
  color: #6b7280;
  margin: 4px 0 14px;
}

.iv-card:first-child .iv-subtitle {
  padding-right: 160px;
}

#ivEpsScroll {
  position: relative;
  overflow: visible;
}

#ivEpsGrowthWrapper .datatable-top {
  position: absolute;
  top: -36px;
  right: 0;
  margin: 0;
  padding: 0;
}

#ivEpsGrowthWrapper .datatable-container {
  max-height: 395px;
  overflow-y: auto;
}

#ivEpsGrowthWrapper .datatable-bottom {
  display: none;
}

#ivEpsGrowthWrapper .datatable-input {
  height: 29px;
  width: 150px;
  min-width: 0 !important;
  padding: 3px 8px;
  font-size: 12.5px;
  border-radius: 7px;
  box-sizing: border-box;
}

#ivPerfSubtitle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

#ivPerfSearchInput {
  height: 32px;
  width: 235px;
  padding: 4px 10px;
  font-size: 13px;
  border: 1px solid #000000;
  border-radius: 8px;
  box-sizing: border-box;
  margin-left: auto;
}



.iv-card > .iv-toggle {
  grid-area: toggle;
  align-self: center;
  justify-self: end;
}

.iv-card > .iv-table-scroll,
.iv-card > #ivEpsScroll {
  grid-area: body;
  align-self: stretch;
}

.iv-card > .iv-performance-columns {
  grid-area: body;
}

.iv-full-width-card {
  position: relative;
  width: 100%;
  margin: 0 auto 24px;
  background: #ffffff;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 2px 10px rgba(20, 30, 60, 0.06);
}

.iv-full-width-card h2 {
  font-size: 19px;
  margin: 0 0 4px;
  color: #111827;
}

.iv-full-width-card .iv-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 14px;
  max-width: calc(100% - 240px);
}

.iv-full-width-card .table-responsive {
  position: static;
}

.iv-full-width-card .datatable-top {
  position: absolute;
  top: 20px;
  right: 22px;
  margin: 0;
}

#iv-eps-table {
  width: 100% !important;
  table-layout: fixed !important;
}

#iv-eps-table th,
#iv-eps-table td {
  padding: 6px 4px !important;
  vertical-align: middle;
}

#iv-eps-table th:nth-child(1),
#iv-eps-table td:nth-child(1) {
  width: 18% !important;
  text-align: center !important;
}

#iv-eps-table th:nth-child(1) .datatable-sorter {
  white-space: nowrap !important;
  justify-content: center !important;
}

#iv-eps-table th:nth-child(2),
#iv-eps-table td:nth-child(2) {
  width: 54% !important;
  white-space: normal !important;
  word-break: break-word;
  line-height: 1.35;
  text-align: left !important;
}

#iv-eps-table th:nth-child(2),
#iv-eps-table th:nth-child(2) .datatable-sorter {
  justify-content: flex-start !important;
  text-align: left !important;
}

#iv-eps-table th:nth-child(3),
#iv-eps-table td:nth-child(3) {
  width: 28% !important;
  text-align: center !important;
}


/* ================= Link & Icon ================= */
.iv-index-link {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  display: inline;
  vertical-align: middle;
  transition: color 0.15s ease, font-weight 0.15s ease;
}

.iv-index-link:hover {
  color: #000;
  font-weight: 700;
}

.compact-table.sticky-first-col tbody tr:hover td:first-child {
  background-color: #e8f4f8;
}

.iv-index-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}


/* ================= Status & Value Colors ================= */
.iv-value-up {
  color: #1c9e63;
  font-weight: 600;
}

.iv-value-down {
  color: #d0384a;
  font-weight: 600;
}

/* ================= Performance Overview & Cards ================= */
.iv-performance-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.iv-performance-box {
  background: #ffffff;
  border: 1px solid #eef0f4;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(20, 30, 60, 0.05);
  min-width: 0;
}

.iv-performance-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
}

.iv-performance-slider {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 4px;
  scroll-behavior: auto;
  max-height: 340px;
}

.iv-performance-slider::-webkit-scrollbar {
  width: 6px;
}

.iv-performance-slider::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 3px;
}

.iv-performance-slider::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.iv-performance-slider::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.iv-perf-card {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.iv-perf-card-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  white-space: normal;
  line-height: 1.3;
  min-width: 0;
}

.iv-perf-card-name span,
.iv-perf-card-name a {
  overflow: hidden;
  text-overflow: ellipsis;
}

.iv-perf-card-value {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ================= Status Badges ================= */
.iv-badge {
  display: inline-block;
  width: 104px;
  text-align: center;
  padding: 4px 0;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.iv-badge.status-overvalued  { background: #fdeced; color: #d0384a; }
.iv-badge.status-undervalued { background: #e6f7ee; color: #1c9e63; }
.iv-badge.status-neutral     { background: #e9f0fd; color: #3457d5; }

.iv-empty-row td {
  text-align: center;
  color: #9aa2b1;
  padding: 24px 6px;
}

.iv-empty-row {
  text-align: center;
  color: #9aa2b1;
  padding: 24px 6px;
}

.skeleton {
  background: linear-gradient(90deg, #eef0f4 25%, #e4e7ed 37%, #eef0f4 63%);
  background-size: 400% 100%;
  animation: iv-skeleton-shimmer 1.4s ease infinite;
  border-radius: 4px;
  display: inline-block;
}

@keyframes iv-skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

@media (max-width: 900px) {
  .iv-two-col-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .iv-page {
    padding: 28px 16px 48px;
  }

  .iv-hero h1 {
    font-size: 30px;
  }

  .iv-hero p {
    font-size: 14px;
  }

  .iv-tabs-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .iv-tabs-bar::-webkit-scrollbar {
    display: none;
  }

  .iv-tabs-bar .iv-tab {
    padding-inline: 1.1rem;
    padding-block: 0.6rem;
    font-size: 14px;
  }

  .iv-card,
  .iv-full-width-card {
    padding: 16px;
    border-radius: 12px;
  }

  .iv-card h2,
  .iv-full-width-card h2 {
    font-size: 17px;
  }

  .iv-performance-columns {
    grid-template-columns: 1fr;
  }
  .iv-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto 1fr;
    grid-template-areas:
      "title"
      "toggle"
      "subtitle"
      "body";
  }

  .iv-card:first-child .iv-subtitle {
    padding-right: 0;
  }

  .iv-card > .iv-toggle {
    justify-self: start;
    margin-top: 6px;
    margin-bottom: 8px;
  }

  .iv-card .iv-subtitle {
    max-width: 100%;
    margin: 2px 0 6px;
  }

  #ivEpsGrowthWrapper .datatable-top {
    position: static;
    margin: 4px 0 10px;
  }

  #ivEpsGrowthWrapper .datatable-input,
  #ivPerfSearchInput,
  .iv-full-width-card .datatable-input {
    width: 100%;
    min-width: 0 !important;
    margin-left: 0;
  }

  #ivPerfSubtitle {
    flex-wrap: wrap;
    gap: 8px;
  }

  .iv-full-width-card .iv-subtitle {
    max-width: 100%;
    margin-bottom: 8px;
  }

  .iv-full-width-card .datatable-top {
    position: static;
    margin: 4px 0 12px;
  }

  #iv-eps-table th:nth-child(1),
  #iv-eps-table td:nth-child(1) {
    width: 20% !important;
    min-width: 58px !important;
  }

  #iv-eps-table th:nth-child(2),
  #iv-eps-table td:nth-child(2) {
    width: 48% !important;
    padding-right: 6px !important;
  }

  #iv-eps-table th:nth-child(3),
  #iv-eps-table td:nth-child(3) {
    width: 32% !important;
    text-align: right !important;
    padding-right: 8px !important;
  }

  #iv-eps-table th:nth-child(3) .datatable-sorter {
    justify-content: flex-end !important;
  }
}

/* ---- Phones (<=640px) ---- */
@media (max-width: 640px) {
  .iv-badge {
    width: 84px;
    font-size: 11.5px;
    padding: 3px 0;
  }
}

@media (max-width: 380px) {
  .iv-hero h1 {
    font-size: 26px;
  }

  .iv-tabs-bar .iv-tab {
    padding-inline: 0.9rem;
    padding-block: 0.55rem;
    font-size: 13px;
  }

  .iv-perf-card-name {
    font-size: 12px;
  }

  .iv-perf-card-value {
    font-size: 12.5px;
  }
}

/* ================= DataTable Pagination Alignment ================= */
#ivValuationWrapper .datatable-wrapper .datatable-bottom,
#ivEmaWrapper .datatable-wrapper .datatable-bottom,
.iv-page .datatable-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

#ivValuationWrapper .datatable-pagination,
#ivEmaWrapper .datatable-pagination,
.iv-page .datatable-pagination {
  margin-left: auto;
}

/* Table Header Center Alignment */
.compact-table th:not(:first-child),
.compact-table th:not(:first-child) .datatable-sorter {
  justify-content: center !important;
  text-align: center !important;
}