/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(to bottom right, #f8fafc, #e2e8f0);
  min-height: 100vh;
  color: #334155;
}

.hidden {
  display: none !important;
}

/* Version Badge */
.version-badge {
  position: fixed;
  top: 10px;
  right: 10px;
  background-color: #2563eb;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 1000;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: #1e293b;
  border-bottom: 1px solid #475569;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.container {
  max-width: 98%;
  margin: 0 auto;
  padding: 0 1rem;
}

.header-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 0;
}

.header-left {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.logo-container {
  /* background: linear-gradient(to bottom right, #3b82f6, #2563eb); */
  /* padding: 0.625rem; */
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  display: flex;
}

.logo-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: white;
  stroke-width: 2;
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-titles {
  display: flex;
  flex-direction: column;
}

.header-title {
  color: white;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
}

.header-subtitle {
  color: #94a3b8;
  font-size: 0.875rem;
  font-size: 12px;
  font-style: italic;
  margin-right: 2.5rem;
}

.hospital-filter-container {
  position: relative;
  /* margin-top: 0.25rem; */
  padding: 8px 4px;
  /* display: none; */
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.hospital-filter-label {
  font-size: 14px;
  font-weight: 500;
  line-height: 2;
}

.filter-button {
  width: 15rem;
  height: 2rem;
  background-color: white;
  border: 1px solid #ccc;
  color: black;
  font-size: 0.875rem;
  padding: 0 0.75rem;
  border-radius: 0.375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.2s;
  padding: 5px 10px;
}

.chevron-icon,
.compare-icon {
  width: 1rem;
  height: 1rem;
  opacity: 0.5;
}

.filter-dropdown {
  position: absolute;
  top: calc(85% + 0.25rem);
  right: 0;
  width: 16rem;
  background-color: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.filter-header {
  padding: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.filter-list {
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.5rem;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.filter-item:hover {
  background-color: #f8fafc;
}

.filter-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.filter-item label {
  flex: 1;
  cursor: pointer;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.header-content-class{
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
}
.header-subtitle-content{
    position: absolute;
    right: 35px;
    bottom: 3px;
    
}
.emptyHeaderClass {
    background: #fff !important;
}

/* Data Source Indicator */
.data-source-indicator {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.125rem;
  padding: 0.375rem 0.75rem;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 0.375rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: none;
}

#dataSourceText {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
}

.last-updated {
  font-size: 0.625rem;
  color: #64748b;
}

.data-source-indicator.live #dataSourceText {
  color: #10b981;
}

.data-source-indicator.demo #dataSourceText {
  color: #f59e0b;
}

.data-source-indicator.error #dataSourceText {
  color: #ef4444;
}

/* Refresh Button */
.refresh-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(to bottom right, #3b82f6, #2563eb);
  color: white;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

  display: none;
}

.refresh-button:hover {
  background: linear-gradient(to bottom right, #2563eb, #1d4ed8);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.refresh-button:active {
  transform: translateY(0);
}

.refresh-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.refresh-icon {
  width: 1rem;
  height: 1rem;
  stroke-width: 2;
}

.refresh-button.loading .refresh-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.compare-icon-view {
  border: 1px solid #475569;
  border-radius: 5px;
  background: transparent;
  padding: 7px 13px;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.compare-icon-view.active {
  background-color: #1d4ed8;
  color: #fff !important;
  border: 1px solid #1d4ed8 !important;
}
.compare-icon-view.active::after {
  background: transparent !important;
}

.view-tabs {
  /* border-bottom: 1px solid #475569; */
  display: flex;
  align-items: center;
  gap: 0rem;
  padding-bottom: 0.125rem;
  padding-right: 0.5rem;
}

.view-tabs button:last-child {
  margin-left: 0.5rem;
  border: 1px solid #475569;
  border-radius: 6px;
}

.tab-button {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  color: #94a3b8;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-bottom: 1px solid #475569;
}

.tab-button:hover {
  color: #cbd5e1;
}

.tab-button.active {
  color: #60a5fa;
}

.tab-button.active::after {
  content: "";
  position: absolute;
  bottom: -0.1125rem;
  left: 0;
  right: 0;
  height: 0.125rem;
  background-color: #60a5fa;
}

.compare-button {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  background-color: #1e293b;
  border: 1px solid #475569;
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
  font-size: 0.875rem;
}

.compare-button:hover {
  background-color: #334155;
}

.compare-button.active {
  background-color: #2563eb;
  color: white;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Main Content */
.main-content {
  padding: 1.5rem 0;
}

.content-container {
  max-width: 98%;
  margin: 0 auto;
  padding: 0 1rem;
}

.compa-td{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-direction: row;
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 1px;
  font-size: 0.85rem;
  justify-content: flex-end;
}

.kpi-trend.compa{
  gap: 0px !important;
}

.svgClass{
    width: 22px;
    height: 11px;
}

.trend-text.compa {
  font-size: 0.65rem;
}

.arrow-icon {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.arrow-icon svg {
  width: 100%;
  height: 100%;
  stroke: green;
}

/* Up = Green, Down = Red + Rotate */
.trend-up .arrow-icon {
  color: #0aa85a;
}

.trend-down .arrow-icon {
  color: #e63946;
  transform: rotate(180deg);
}

/* tooltip  */
.kpi-section-container .info-icon {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

/* Tooltip */
.kpi-section-container .info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-45%);
  background: #000;
  color: #fff;
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 11px;
  opacity: 0;
  visibility: hidden;
  white-space: nowrap;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

/* Tooltip arrow */
.kpi-section-container .info-icon::before {
  content: "";
  position: absolute;
  bottom: 25%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #000 transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

/* Show tooltip on hover */
.kpi-section-container .info-icon:hover::after,
.kpi-section-container .info-icon:hover::before {
  opacity: 1;
  visibility: visible;
}

.kpi-section-container .info-icon.tooltip-active::after,
.kpi-section-container .info-icon.tooltip-active::before {
  opacity: 1;
  visibility: visible;
}

.sticky-col .info-icon {
  position: relative;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  left: 0%;
  top: 50%;
  transform: translate(-50%, 15%);
  margin: 0 0.5rem;
}

/* Tooltip */
.sticky-col .info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 100%;
  transform: translateX(-42%);
  background: #000;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 10px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  pointer-events: none;

  white-space: normal;
  /* allows wrapping */
  word-break: break-word;
  /* breaks long words */
  max-width: 200px;
  /* keeps tooltip from stretching too wide */
  width: max-content;
  /* only expands as much as needed */
  line-height: 1.2;
}

/* Arrow */
.sticky-col .info-icon::before {
  content: "";
  position: absolute;
  bottom: 25%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #000 transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

/* Show on hover */
.sticky-col .info-icon:hover::after,
.sticky-col .info-icon:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Mobile tap support */
.sticky-col .info-icon.tooltip-active::after,
.sticky-col .info-icon.tooltip-active::before {
  opacity: 1;
  visibility: visible;
}

/* KPI Cards */
.kpi-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.kpi-card small {
  font-size: 11px;
}

@media (max-width: 1024px) {
  .kpi-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kpi-section-container {
  overflow-x: auto;
  padding: 10px;
  background-color: white;
  border-radius: 0.5rem;
  margin-bottom: 20px;
}

.kpi-card {
  background: white;
  padding: 10px;
  border-right: 1px solid #e2e8f0;
  font-size: 20px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 0px;
  font-size: 0.85rem;
  font-weight: 500;
}

.arrow-icon {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.arrow-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

/* Green + up arrow */
.trend-up {
  color: #0aa85a;
}

/* Red + down arrow (rotated) */
.trend-down {
  color: #e63946;
}

.trend-down .arrow-icon {
  transform: rotate(180deg);
}

.kpi-card:last-child {
  border-right: none;
}

.kpi-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.kpi-details {
  flex: 1;
  min-width: 0;
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.kpi-label .info-icon {
  width: auto;
  display: flex;
}

.info-icon img {
  width: 12px;
}

.kpi-content-data {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.svg-icon-arrow svg {
  width: 10px;
}

.kpi-value {
  font-size: 1.25rem;
  font-weight: 500;
  color: #1d4ed8;
  margin-bottom: 0.125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-trend {
  font-size: 0.75rem;
  color: #475569;
}

.kpi-icon {
  padding: 0.375rem;
  border-radius: 0.5rem;
  flex-shrink: 0;
}

.kpi-icon svg {
  width: 1rem;
  height: 1rem;
  color: white;
}

.icon-blue {
  background-color: #3b82f6;
}

.icon-green {
  background-color: #22c55e;
}

.icon-orange {
  background-color: #f97316;
}

.icon-purple {
  background-color: #a855f7;
}

.icon-emerald {
  background-color: #10b981;
}

/* Section Titles */
.section-title {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1rem;
  /* padding: 0 1.5rem; */
}

.section-subtitle {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.75;
  color: #0f172a;
}

.table-section .section-title {
  /* padding-top: 1.5rem; */
}

/* Metrics Card */
.metrics-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);

  background: transparent;
  box-shadow: unset;
  border: unset;
}

.table-container {
  overflow-x: auto;
}

.metrics-table {
  border-collapse: collapse;
  font-size: 0.875rem;
}

.metrics-table thead tr {
  background-color: #1e293b;
  border-bottom: 1px solid #475569;
}
.metrics-table thead tr th:last-child {
  border-top-right-radius: 0.5rem;
  border-right: unset;
}

.metrics-table th {
  color: white;
  padding: 0.75rem 1rem;
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.025em;
  border-right: 1px solid #475569;
  min-width: 122px;
}

.metrics-table th.sticky-col {
  position: sticky;
  left: 0;
  z-index: 10;
  background-color: #1e293b;
  box-shadow: 2px 0 8px -2px rgba(0, 0, 0, 0.2);
  min-width: 50px;
  text-align: left;
  width: 200px;
}

.metrics-table .sticky-col svg {
  position: absolute;
  width: 15px;
  color: #fff;
  background: darkgray;
  border-radius: 12px;
  border: unset;
}

.metrics-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
}

.metrics-table tbody tr:nth-child(even) {
  background-color: #e2e8f0;
}

.metrics-table tbody tr:hover {
  background-color: #f1f5f9;
}

.metrics-table td {
  padding: 0.625rem 0.75rem;
  text-align: center;
  color: #475569;
  border-right: 1px solid #e2e8f0;
  transition: background-color 0.15s;
  background: #fff;
}

.metrics-table td.sticky-col {
  position: sticky;
  left: 0;
  z-index: 5;
  background: #fff;
  box-shadow: 2px 0 6px -2px rgba(0, 0, 0, 0.08);
  text-align: left;
  font-weight: 500;
  color: #475569;
  padding-left: 1rem;
  
}
tbody tr:nth-child(even) > td {
  background-color: #f7f4f4;
}
.metrics-table tbody tr:nth-child(even) td.sticky-col {
  background-color: #f7f4f4;
}

/* Summary Sections */
.summary-section {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  margin: 1.5rem 0;
}

.conversion-section-compact {
  margin-top: 2rem;
}

.summary-header {
  background-color: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  padding: 1rem 0.5rem;
  font-size: 24px;
}

.summary-header .section-title {
  margin: 0;
  padding: 0;
  font-size: 20px;
}

.financial-summary,
.ticketing-summary,
.conversion-summary {
  padding: 0.75rem;
}

.summary-grid {
  overflow-x: auto;
  padding: 5px;
  background-color: white;
  border-radius: 0.5rem;
  margin-bottom: 20px;
  display: flex;
  flex-direction: row;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s;
  border: 1px solid #E2E8F0;
  width: fit-content;
}

.conversion-title-data {
  grid-template-columns: repeat(2, 1fr);
  max-width: 800px;
  padding: 8px 0px 9px 0px !important;
  display: grid;
  padding: 10px 10px 10px 10px;
  gap: 15px;
}

.summary-card {
  display: grid;
  grid-template-columns: 9fr 1fr;
}


/* .summary-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
} */

.summary-card-content {
  background: white;
  padding: 10px;
  border-left: 1px solid #e2e8f0;
  font-size: 20px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.summary-grid .summary-card:first-child .summary-card-content {
  border-left: none;
}
.summary-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 0.25rem;
  white-space: nowrap;
}

.summary-card-value {
  font-size: 1.25rem;
  font-weight: 500;
  color: #1D4ED8;
  /* margin-bottom: 0.125rem; */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-card-trands{
    display: flex;
    flex-direction: row;
    gap: 4px;
}

.summary-card-icon {
  flex-shrink: 0;
  padding: 0.375rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

/* Financial Sections */
.financial-sections {
  /* padding: 0.75rem; */
}

.financial-section {
  margin-bottom: 1.5rem;
}

.financial-section-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1rem;
  /* padding: 1.5rem 1.5rem 0 1.5rem; */
}

.section-separator {
  height: 1px;
  background-color: #cbd5e1;
  margin: 2rem 0;
}

.table-footer {
  padding: 0.5rem 1rem;
  background-color: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.table-footer p {
  font-size: 0.75rem;
  color: #475569;
  margin: 0;
}

/* Conversion Section */
.conversion-section-content {
  /* padding: 0.75rem; */
}

.conversion-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  /* margin-bottom: 0.75rem; */
  /* padding: 0 1rem; */
}

/* Comparison Section */
.comparison-section {
  padding: 1.5rem;
}

#comparisonResults .section-title {
  margin: 0;
}

.comparison-section .section-title {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.comparison-content {
  width: 100%;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.comparison-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s;
}

.comparison-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.comparison-card-header {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.comparison-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.comparison-metric:last-child {
  border-bottom: none;
}

.comparison-metric-label {
  color: #64748b;
  font-size: 0.875rem;
}

.comparison-metric-value {
  color: #0f172a;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  /* padding: 1.5rem; */
}

.revenue-data-charts {
  padding: 10px;
}

@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.chart-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 1rem;
}

canvas {
  max-height: 300px;
  width: 100% !important;
}

/* Comparison View */
.comparison-section {
  padding: 1.5rem;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.comparison-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.comparison-card-header {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.comparison-metric {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.comparison-metric-label {
  color: #64748b;
  font-size: 0.875rem;
}

.comparison-metric-value {
  color: #0f172a;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Analytics Section */
.analytics-section {
  padding-top: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0;
  }

  .header-subtitle-content{
    position: relative;
    right: 0;
    bottom: 0;
  }

  .view-tabs {
    gap: 0.5rem;
  }

  .view-tabs button:last-child {
    margin-left: 0rem;
  }

  .header-left {
    flex-direction: column;
    gap: 0.5rem;
  }

  .header-left,
  .header-right {
    width: 100%;
  }

  .kpi-cards {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    /* display: flex; */
    /* flex-wrap: wrap; */
    flex-direction: column;
  }
  .summary-card-content{
    width: max-content;
  }
  .summary-card-trands{
    gap: 10px;
  }

  .kpi-card {
    flex: 1;
    min-width: 100px;
    border-bottom: 1px solid #e2e8f0;
    border-right: none;
  }

  .metrics-table {
    font-size: 0.75rem;
  }

  .metrics-table th,
  .metrics-table td {
    padding: 0.5rem;
    min-width: 100px;
  }
}

/* Scrollbar Styling */
.table-container::-webkit-scrollbar,
.filter-list::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.table-container::-webkit-scrollbar-track,
.filter-list::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.table-container::-webkit-scrollbar-thumb,
.filter-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover,
.filter-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================================
   COMPARISON DASHBOARD STYLES
   ============================================ */

/* Comparison Accordion */
.comparison-accordion {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.accordion-header:hover {
  background-color: #f8fafc;
}

.accordion-title-section {
  flex: 1;
}

.accordion-title {
  color: #475569;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.selection-summary {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
}

.selection-summary strong {
  color: #334155;
  font-weight: 600;
}

.selection-summary div {
  margin-top: 0.25rem;
}

.accordion-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: #64748b;
  transition: transform 0.3s;
}

.accordion-icon.rotated {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 0 1.5rem 1.5rem;
}

/* Selection Grid */
.selection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.selection-section {
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 1rem;
  background-color: #f8fafc;
}

.selection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.selection-label {
  font-size: 0.875rem;
  color: #475569;
  font-weight: 500;
}

.select-all-btn {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  background-color: white;
  border: 1px solid #cbd5e1;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.2s;
}

.select-all-btn:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
}

.selection-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  padding: 0.75rem;
  background-color: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.25rem;
}

.selection-list.month-list {
  grid-template-columns: repeat(3, 1fr);
}

.checkbox-item {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.25rem;
}

.checkbox-item input[type="checkbox"] {
  margin-right: 0.5rem;
  cursor: pointer;
  width: 1rem;
  height: 1rem;
}

.checkbox-item span {
  color: #334155;
}

/* Comparison Footer */
.comparison-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.comparison-count {
  font-size: 0.875rem;
  color: #64748b;
}

.comparison-count strong {
  color: #334155;
  font-weight: 600;
}

.comparison-count .comparison-total {
  color: #2563eb;
  font-weight: 700;
}

.compare-action-btn {
  padding: 0.5rem 2rem;
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 0.375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.compare-action-btn:hover:not(.disabled) {
  background-color: #1d4ed8;
}

.compare-action-btn.disabled {
  background-color: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
}

/* Comparison Results */
#comparisonResults {
  margin-top: 1.5rem;
}

/* Summary Cards */
.comparison-summary-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.summary-card-small {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.summary-card-small:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.summary-card-icon {
  padding: 0.375rem;
  border-radius: 0.5rem;
  flex-shrink: 0;
}

.summary-card-icon svg {
  width: 1rem;
  height: 1rem;
  color: white;
}

.summary-card-details {
  flex: 1;
  min-width: 0;
}

.summary-card-label {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.summary-card-value-large {
  font-size: 1.25rem;
  font-weight: 500;
  color: #0f172a;
  margin-bottom: 0.125rem;
  line-height: 1.2;
}

.summary-card-subtitle {
  font-size: 0.75rem;
  color: #64748b;
}

/* Icon Colors */
.icon-blue {
  background-color: #3b82f6;
}

.icon-green {
  background-color: #22c55e;
}

.icon-orange {
  background-color: #f97316;
}

.icon-purple {
  background-color: #a855f7;
}

.icon-emerald {
  background-color: #10b981;
}

/* Comparison Table Section */
.comparison-table-section {
  margin-bottom: 2rem;
  padding: 1rem;
}

.subsection-title {
  color: #64748b;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  margin-top: 1rem;
}

td {
  white-space: pre !important;
  font-size: 12px;
}

/* Responsive Design for Comparison */
@media (max-width: 1200px) {
  .comparison-summary-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .selection-grid {
    grid-template-columns: 1fr;
  }

  .comparison-summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .comparison-footer {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .compare-action-btn {
    width: 100%;
  }

  .selection-list {
    grid-template-columns: 1fr;
  }

  .selection-list.month-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .tab-button {
    gap: 0.5rem;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 100px;
    color: #fff;

    background-color: #1e293b;
    border: 1px solid #475569;
    color: #cbd5e1;
    white-space: nowrap;

    padding: 0.5rem 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .tab-button.active {
    color: #fff !important;
    background: linear-gradient(to bottom right, #3b82f6, #2563eb);
    border: unset;
  }

  .tab-button.active::after {
    display: none;
  }

  .view-tabs {
    border-bottom: none;
    background: #39426b;
    padding: 5px;
    border-radius: 5px;
  }

  .compare-button {
    padding: 0.5rem;
  }

  .metrics-card {
    /* margin: 0 0.25rem !important; */
  }

  .financial-summary,
  .ticketing-summary,
  .conversion-summary {
    padding: 0;
  }

  .summary-grid {
    padding: 0.25rem 0 0.5rem !important;
    margin: 0 0 1rem 0;
    width: auto;
  }

  .financial-sections,
  .ticketing-summary,
  .conversion-summary {
    padding: 0.75rem;
  }

  .financial-section-title {
    padding: 0.25rem;
    margin: 0;
    font-size: 1rem;
  }

  .conversion-title {
    padding: 0.25rem;
    margin: 0;
    font-size: 1.25rem;
  }

  .summary-header .section-title {
    font-size: 1.25rem;
  }

  #tableView .section-title {
    font-size: 1.25rem;
    padding: 0;
  }

  #analyticsView .summary-section .charts-grid {
    padding: 1rem;
  }

  #analyticsView .section-title {
    font-size: 1.5rem;
    padding: 0;
    margin: 0;
  }

  .charts-grid {
    padding: 1rem 0;
  }

  .comparison-section {
    padding: 0;
  }

  #comparisonView .section-title {
    font-size: 1.5rem;
    padding: 0;
  }

  .kpi-icon {
    display: none;
  }

  .kpi-value {
    font-size: 1rem;
  }

  .metrics-table td {
    font-weight: 600;
  }

  .summary-card-value {
    font-size: 1rem;
  }

  #comparisonResults .comparison-summary-cards {
    grid-template-columns: 1fr 1fr;
  }
  #comparisonResults .comparison-summary-cards {
    grid-template-columns: 1fr 1fr;
  }
  #comparisonView .accordion-header {
    padding: .75rem;
    align-items: flex-start;
    gap: .5rem;
  }
  #comparisonView .accordion-icon {
    width: 1rem;
    height: 1rem;
  }
  #comparisonView .accordion-title {
    font-size: .9rem;
    border-bottom: 1px dotted #ddd;
    padding: 0 0 .25rem 0;
  }
  #comparisonView .selection-summary {
    font-size: 0.7rem;
  }
  #hospitalFilterContainer {
    gap: 1rem;
  }
  #hospitalFilterContainer .section-subtitle {
    font-size: .8rem;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .comparison-summary-cards {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   CSV DATA LOADING STYLES
   ============================================ */

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  background: white;
  border-radius: 0.75rem;
  padding: 2rem 3rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  text-align: center;
  animation: fadeIn 0.3s ease-in-out;
}

.loading-spinner {
  width: 3rem;
  height: 3rem;
  border: 4px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.loading-subtext {
  font-size: 0.875rem;
  color: #64748b;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Error Toast */
.error-toast {
  position: fixed;
  top: 80px;
  right: 20px;
  background: white;
  border-left: 4px solid #ef4444;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  padding: 1rem 1.25rem;
  z-index: 9998;
  max-width: 400px;
  animation: slideIn 0.3s ease-out;
}

.error-toast-content {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.error-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: #ef4444;
  flex-shrink: 0;
}

.error-message {
  flex: 1;
  color: #334155;
  font-size: 0.875rem;
  line-height: 1.5;
}

.error-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s;
}

.error-close:hover {
  color: #334155;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}
.capacityCell,.label-subheader {
  text-align: left;
  background: #e2e8f0 !important;
  font-size: .85rem !important;
  font-weight: 600 !important;
  padding: 1rem .5rem  !important;
  /* border-top: 2px solid #1e293b; */
}

.emptyHeaderClass, .emptyHeaderClass.capacityCell {
    background: #fff !important;
    padding: 0.3rem !important;
    border: unset !important;
}
.borderUnsetParent {
    border: unset !important;
}
.label-subheader.border-top {
    /* border-top-left-radius: 10px !important; */
}

/* Collapsible Subheader Styles for Metrics Table */
.collapsible-section {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 12px;
    background: #fff;
  }
  
  .collapsible-header {
    background: #1e293b;
    color: #fff;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
  }
  
  .collapsible-header::after {
    content: "▼";
    font-size: 0.8rem;
    transition: transform 0.25s ease;
  }
  
  .collapsible-section.open .collapsible-header::after {
    transform: rotate(180deg);
  }
  
  .collapsible-content {
    display: none;
    padding: 10px;
    overflow-x: auto;
  }
  
  .collapsible-section.open .collapsible-content {
    display: block;
  }
  
  .inner-metrics-table {
    width: 100%;
    border-collapse: collapse;
  }
  
  .inner-metrics-table td,
  .inner-metrics-table th {
    padding: 6px 10px;
    border-bottom: 1px solid #e5e7eb;
  }
  .collapsible-header-row {
    cursor: pointer;
    position: relative;
  }
  
  .collapsible-header-row .collapse-icon {
    display: inline-block;
    color: #1e293b;
    transition: transform 0.25s ease;
  }

/* === Sticky header + inner scroll for all dashboard tables === */

/* 1) Make the table area scrollable vertically (and horizontally if needed) */
.table-container{
  max-height: 60vh;           /* adjust if you want a taller/shorter viewport */
  overflow: auto;             /* enables both x & y scrolls inside the box */
}

/* 2) Make header sticky for all tables (metrics, comparison, staff, cost, etc.) */
.metrics-table thead th{
  position: sticky;
  top: 0;                     /* sticks to the top of the table container */
  z-index: 11;                /* above body cells */
  background-color: #1e293b;  /* keep existing header bg */
  /* Remove vertical borders in header */
  border-right: 0 !important;
}

/* Stronger layering for the top-left sticky intersection cell */
.metrics-table thead th.sticky-col{
  left: 0;
  z-index: 15;                /* above other header cells */
  box-shadow: 2px 0 8px -2px rgba(0,0,0,.2);
}

/* 3) Keep body cell borders as-is (header has none) */
.metrics-table tbody td{
  border-right: 1px solid #e2e8f0; /* preserve existing column dividers */
}

/* Optional: if you see a faint line at the far right of header */
.metrics-table thead tr th:last-child{
  border-right: 0 !important;
}
 
