/* ==========================================================================
   REGULATORY COMPLIANCE PORTAL - STYLESHEET
   Government of India - Ministry of Commerce and Industry
   ========================================================================== */

:root {
  /* Color Palette - Premium & High Contrast */
  --bg-main: #F4F6F9;
  --bg-card: #FFFFFF;
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  --border-light: #F1F5F9;

  /* Primary Brand Colors */
  --navy-primary: #0F172A;
  --navy-hover: #1E293B;
  --blue-accent: #2563EB;

  /* Indian Tricolor Accent */
  --tricolor-saffron: #FF9933;
  --tricolor-white: #FFFFFF;
  --tricolor-green: #138808;

  /* Category Specific Colors */
  --color-act: #10B981;
  --color-act-bg: #ECFDF5;
  --color-policy: #2563EB;
  --color-policy-bg: #EFF6FF;
  --color-compliance: #8B5CF6;
  --color-compliance-bg: #F5F3FF;
  --color-reform: #F97316;
  --color-reform-bg: #FFF7ED;

  /* Status Colors */
  --status-reduced-bg: #DEF7EC;
  --status-reduced-text: #03543F;
  --status-review-bg: #FEF08A;
  --status-review-text: #713F12;
  --status-rejected-bg: #FDE8E8;
  --status-rejected-text: #9B1C1C;

  /* Layout Tokens */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;

  /* Font Scaling Variable */
  --font-scale: 1;
  --base-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: calc(14px * var(--font-scale));
}

body {
  font-family: var(--base-font);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 24px;
}

a {
  color: var(--blue-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Page Container */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ==========================================================================
   TOP HEADER - DARK NAVY (MATCHING IMAGE 2)
   ========================================================================== */
.top-header {
  background: linear-gradient(135deg, #1a1f5e 0%, #1c2372 50%, #162058 100%);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  width: 100%;
  min-height: 80px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
}

.emblem-img {
  height: 58px;
  width: auto;
  object-fit: contain;
  /* Keep original gold/natural color of Ashoka Emblem on dark bg */
  filter: none;
}

.brand-titles {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgba(255,255,255,0.2);
  padding-left: 14px;
}

.govt-title-hi {
  font-size: 0.88rem;
  font-weight: 700;
  color: #F5A623;
  line-height: 1.2;
}

.govt-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: #F5A623;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1.2;
}

.ministry-title {
  font-size: 0.73rem;
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1.25;
  margin-top: 1px;
}

.dept-title {
  font-size: 0.66rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.25;
}

/* Right side: Portal Title + Utilities */
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  padding: 12px 0;
}

.portal-title-wrapper {
  text-align: right;
}

.portal-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.5px;
  line-height: 1.15;
  margin: 0;
}

/* Header Utilities Row */
.header-utilities-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.font-resizer {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 5px;
  padding: 2px;
}

.font-btn {
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  border-radius: 4px;
  transition: all 0.15s ease;
}

.font-btn:hover, .font-btn.active {
  background: rgba(255,255,255,0.2);
  color: #FFFFFF;
}

.lang-selector select {
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 5px;
  background: rgba(255,255,255,0.12);
  font-size: 0.75rem;
  font-weight: 600;
  color: #FFFFFF;
  cursor: pointer;
}

.icon-badge-btn {
  position: relative;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 5px;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
}

.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #EF4444;
  color: #FFFFFF;
  font-size: 0.58rem;
  font-weight: 800;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #1c2372;
}

.user-dropdown {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #FFFFFF;
  cursor: pointer;
}

/* Single Calendar Date Input (header) */
.calendar-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.cal-icon {
  position: absolute;
  left: 10px;
  pointer-events: none;
  color: rgba(255,255,255,0.75);
  z-index: 1;
}

.header-date-input {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px 5px 30px;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 155px;
}

.header-date-input:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
}

.header-date-input:focus {
  outline: none;
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.5);
}

/* Style the calendar picker icon color to white on webkit */
.header-date-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.7;
  cursor: pointer;
}

.export-btn {
  background: #FFFFFF;
  color: #1c1c56;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: background 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.export-btn:hover {
  background: #F1F5F9;
  transform: translateY(-1px);
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.main-nav-container {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  width: 100%;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 0 16px;
  max-width: 1440px;
  margin: 0 auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  cursor: pointer;
}

.nav-item:hover {
  color: var(--navy-primary);
  background: rgba(241, 245, 249, 0.6);
}

.nav-item.active {
  color: var(--navy-primary);
  font-weight: 800;
  border-bottom-color: var(--navy-primary);
  background: #F8FAFC;
}

.nav-icon {
  width: 15px;
  height: 15px;
  stroke-width: 2px;
}

.nav-item:hover {
  color: var(--navy-primary);
  background: rgba(241, 245, 249, 0.6);
}

.nav-item.active {
  color: var(--navy-primary);
  font-weight: 800;
  border-bottom-color: var(--navy-primary);
  background: #F8FAFC;
}

.nav-icon {
  width: 15px;
  height: 15px;
  stroke-width: 2px;
}

/* ==========================================================================
   VIEW SECTIONS
   ========================================================================== */
.view-section {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   KPI SUMMARY CARDS ROW (4 CARDS)
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: visible;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: #CBD5E1;
  box-shadow: var(--shadow-md);
}

.kpi-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 3;
  width: 100%;
}

.card-title-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.kpi-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.card-select {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

.card-select:hover, .card-select:focus {
  border-color: var(--blue-accent);
  background: #FFFFFF;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin: 2px 0;
}

.kpi-trend {
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-trend.green { color: #059669; }
.kpi-trend.blue { color: #2563EB; }
.kpi-trend.purple { color: #7C3AED; }
.kpi-trend.orange { color: #D97706; }

.kpi-trend-period {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 2px 5px rgba(0, 0, 0, 0.04);
}

.kpi-card:hover .kpi-icon-wrapper {
  transform: scale(1.06);
}

.kpi-icon-wrapper.act { background: #ECFDF5; color: #10B981; border: 1px solid #A7F3D0; }
.kpi-icon-wrapper.policy { background: #EFF6FF; color: #2563EB; border: 1px solid #BFDBFE; }
.kpi-icon-wrapper.compliance { background: #F5F3FF; color: #8B5CF6; border: 1px solid #DDD6FE; }
.kpi-icon-wrapper.reform { background: #FFF7ED; color: #F97316; border: 1px solid #FFEDD5; }

/* ==========================================================================
   SECTION HEADER
   ========================================================================== */
.section-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #0F172A;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

/* ==========================================================================
   CATEGORY BREAKDOWN GRID (STRICT 4 CARDS PER SINGLE ROW)
   ========================================================================== */
.category-grid.four-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  overflow: visible;
  position: relative;
}

.cat-card:hover {
  border-color: #CBD5E1;
  box-shadow: var(--shadow-md);
}

.clickable-state-card {
  cursor: pointer;
  border: 1px solid #99F6E4;
  background: linear-gradient(180deg, #FFFFFF 0%, #F0FDFA 100%);
}

.clickable-state-card {
  cursor: pointer;
}

.clickable-state-card:hover {
  border-color: #0D9488;
  box-shadow: 0 10px 20px -5px rgba(13, 148, 136, 0.15);
  transform: translateY(-2px);
}

.deep-dive-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #0D9488;
  background: #CCFBF1;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

.cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.cat-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-icon-badge {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.cat-icon-badge.act { background: #10B981; }
.cat-icon-badge.ministry { background: #2563EB; }
.cat-icon-badge.state { background: #0D9488; }
.cat-icon-badge.sector { background: #EA580C; }

.cat-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: #0F172A;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.cat-data-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.cat-data-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
}

.cat-data-name-group {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 68%;
}

.cat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cat-data-name {
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-data-val {
  font-weight: 700;
  color: #0F172A;
  display: flex;
  gap: 4px;
}

.cat-data-pct {
  color: var(--text-muted);
  font-weight: 500;
}

.cat-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
  margin-top: auto;
  overflow: visible;
}

.cat-total-box {
  display: flex;
  flex-direction: column;
}

.cat-total-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cat-total-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.1;
}

.cat-visual-box {
  width: 80px;
  height: 80px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.state-map-img {
  width:130px;
  height:130px;
  object-fit: contain;
  filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.08));
  transition: transform 0.2s ease;
}

.state-map-img:hover {
  transform: scale(1.08);
}

/* ==========================================================================
   LOWER SECTION GRID (3 PANELS)
   ========================================================================== */
.lower-grid {
  display: grid;
  grid-template-columns: 270px 1fr 290px;
  gap: 14px;
  margin-bottom: 16px;
}

.lower-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0F172A;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.panel-link {
  font-size: 0.72rem;
  font-weight: 700;
  color: #10B981;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-chart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  overflow: visible;
}

.donut-chart-wrapper {
  position: relative;
  width: 135px;
  height: 135px;
  overflow: visible;
}

.status-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-sq {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.legend-label {
  color: var(--text-secondary);
  font-weight: 600;
}

.legend-val {
  font-weight: 700;
  color: #0F172A;
}

.total-compliances-pill {
  background: #F1F5F9;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  text-align: center;
  margin-top: auto;
  width: 100%;
}

.pill-lbl { font-size: 0.68rem; font-weight: 700; color: var(--text-secondary); }
.pill-val { font-size: 1.2rem; font-weight: 800; color: #0F172A; }

.reforms-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.reforms-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.reforms-table th {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: #F8FAFC;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.reforms-table td {
  padding: 8px 10px;
  font-size: 0.72rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.reforms-table tr:hover td { background: #F8FAFC; }

.reform-sno { font-weight: 600; color: var(--text-muted); }
.reform-name { font-weight: 700; color: #0F172A; }
.reform-dept { color: var(--text-secondary); font-weight: 500; }
.reform-date { color: var(--text-muted); white-space: nowrap; font-size: 0.7rem; }

.status-pill {
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-block;
  white-space: nowrap;
}

.status-pill.reduced { background: var(--status-reduced-bg); color: var(--status-reduced-text); }
.status-pill.review { background: var(--status-review-bg); color: var(--status-review-text); }
.status-pill.rejected { background: var(--status-rejected-bg); color: var(--status-rejected-text); }

.insights-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.insight-icon-box {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.insight-icon-box.green { background: #ECFDF5; color: #10B981; }
.insight-icon-box.orange { background: #FFF7ED; color: #F97316; }
.insight-icon-box.purple { background: #F5F3FF; color: #8B5CF6; }
.insight-icon-box.blue { background: #EFF6FF; color: #2563EB; }

.insight-item strong { color: #0F172A; font-weight: 800; }

.insights-footer-link {
  margin-top: auto;
  text-align: right;
}

/* ==========================================================================
   STATE DEEP-DIVE INNER PAGE STYLES
   ========================================================================== */
.inner-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.inner-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #0F172A;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.back-btn:hover {
  background: #0F172A;
  color: #FFFFFF;
  border-color: #0F172A;
}

.inner-page-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0F172A;
}

.inner-page-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.inner-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.state-select-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0F172A;
}

.state-picker-dropdown {
  padding: 6px 12px;
  border: 1.5px solid #0D9488;
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0F172A;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(13, 148, 136, 0.12);
  outline: none;
}

.state-picker-dropdown:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.state-kpi-grid {
  margin-bottom: 18px;
}

.state-main-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
}

.map-panel {
  grid-column: 1 / 2;
}

.graph-panel {
  grid-column: 2 / 3;
  display: flex;
  flex-direction: column;
}

/* ====== CCCORP MAP COMPONENT STYLES ====== */
.map-content-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.india-map-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.map-image-display-container {
  position: relative;
  width: 100%;
  height: 320px;
  background: #ffffff;
  border: 1.5px solid #1c1c56;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.map-img-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.active-state-map-img {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: contain;
  object-position: center;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(28, 28, 86, 0.12));
  transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}

/* Zoom Controls (Dark Navy matching cccorp) */
.map-zoom-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid #1c1c56;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.map-zoom-btn {
  background: #1c1c56;
  color: #ffffff;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.map-zoom-btn:hover {
  background: #2d8a2d;
}

/* Tooltip (Dark Navy matching cccorp) */
.map-tooltip {
  position: absolute;
  display: none;
  background: rgba(28, 28, 86, 0.95);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, -120%);
  line-height: 1.4;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.india-hotspot-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}


/* Vertical Legend Column on the right */
.cc-map-legend {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 6px;
  flex-shrink: 0;
  width: 82px;
}

.cc-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  color: #1a1a4e;
  font-weight: 700;
}

.cc-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Bottom Stats Row */
.map-bottom-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.map-bottom-stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 5px;
  font-size: 0.7rem;
  border: 1px solid #E2E8F0;
}

.map-bottom-stat-card.green {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #065F46;
}

.map-bottom-stat-card.blue {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
}

.mb-stat-left {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-size: 0.68rem;
}

.mb-stat-right {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.mb-stat-right strong {
  font-size: 0.85rem;
  font-weight: 800;
}

.mb-stat-right span {
  font-size: 0.65rem;
  opacity: 0.75;
}

/* State Detail Overlay View (from cccorp) */
.state-map-view {
  display: none;
  opacity: 0;
  transform: scale(0.96);
  position: absolute;
  inset: 0;
  z-index: 40;
  background: #ffffff;
  flex-direction: column;
  padding: 12px;
  border-radius: var(--radius-md);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  border: 1px solid #E2E8F0;
}

.state-map-view-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 8px;
  gap: 10px;
  z-index: 45;
}

.back-to-national-btn {
  background: #0D9488;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.back-to-national-btn:hover {
  background: #059669;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}

.state-map-view-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

#stateMapViewTitle {
  margin: 0;
  font-size: 15px;
  color: #0F172A;
  font-weight: 800;
  white-space: nowrap;
}

.state-map-view-badge {
  background: #10B981;
  color: #ffffff;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.state-map-view-body {
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
}

.state-map-detail-img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: contain;
  object-position: center;
  border-radius: 4px;
  transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}

.state-info-box {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 60;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid #0D9488;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  width: 180px;
  backdrop-filter: blur(4px);
}

.state-info-header {
  font-weight: 800;
  color: #0F172A;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
  margin-bottom: 6px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-box-category {
  font-size: 9px;
  background: #10B981;
  color: #fff;
  padding: 1px 6px;
  border-radius: 8px;
  flex-shrink: 0;
  font-weight: 700;
}

.state-info-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #334155;
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.info-row strong {
  font-weight: 700;
}

/* Map Legend Strip */
.map-legend-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 8px 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-sm);
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex: 1;
  min-width: 0;
  justify-content: center;
}

.map-legend-item:hover {
  border-color: #0D9488;
  background: #F0FDFA;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.15);
}

.map-leg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.map-leg-name {
  font-size: 0.65rem;
  font-weight: 800;
  color: #0F172A;
}

.map-leg-val {
  font-size: 0.62rem;
  font-weight: 600;
  color: #64748B;
}

.reset-map-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0D9488;
  background: #E6FFFA;
  border: 1px solid #99F6E4;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.reset-map-btn:hover {
  background: #0D9488;
  color: #FFFFFF;
}

.state-chart-wrapper {
  flex: 1;
  min-height: 380px;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.state-chart-wrapper canvas {
  flex: 1;
  width: 100% !important;
  height: 100% !important;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-search-input {
  padding: 4px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: var(--text-primary);
  outline: none;
}

.table-search-input:focus {
  border-color: var(--blue-accent);
}

/* ==========================================================================
   FOOTER SECTION
   ========================================================================== */
.portal-footer {
  border-top: 1px solid var(--border-color);
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   MODAL STYLES
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 460px;
  padding: 20px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0F172A;
}

.modal-close-btn {
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */
@media (min-width: 1441px) {
  .app-container { max-width: 1440px; }
}

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .category-grid.four-cards-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .lower-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .state-main-grid { grid-template-columns: 1fr; }
  .insights-panel-col { grid-column: span 2; }
}

@media (max-width: 840px) {
  .top-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .header-actions { align-items: flex-start; width: 100%; }
  .sub-header-actions { width: 100%; justify-content: space-between; }
  .category-grid.four-cards-row { grid-template-columns: 1fr; gap: 10px; }
  .lower-grid { grid-template-columns: 1fr; }
  .insights-panel-col { grid-column: span 1; }
  .inner-page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
}
