:root {
    --jgsa-bg-page: #f0f4f8;
    --jgsa-bg-card: #ffffff;
    --jgsa-border-color: #d1dce6;
    --jgsa-text-primary: #1a202c;
    --jgsa-text-secondary: #4a5568;
    --jgsa-text-light: #718096;
    --jgsa-primary-color: #2563eb;
    --jgsa-primary-light: #dbeafe;
    --jgsa-primary-dark: #1d4ed8;
    --jgsa-secondary-color: #10b981;
    --jgsa-error-bg: #fef2f2;
    --jgsa-error-border: #fecaca;
    --jgsa-error-text: #dc2626;
    --jgsa-info-bg: #fffbeb;
    --jgsa-info-border: #fde68a;
    --jgsa-info-text: #b45309;
    --jgsa-font-sans: 'Inter', 'Poppins', system-ui, -apple-system, sans-serif;
    --jgsa-font-hindi: 'Poppins', 'Noto Sans Devanagari', sans-serif;
    --jgsa-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --jgsa-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --jgsa-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --jgsa-radius-sm: 0.375rem;
    --jgsa-radius-md: 0.5rem;
    --jgsa-radius-lg: 0.75rem;
    --jgsa-radius-xl: 1rem;
    --jgsa-radius-full: 9999px;
    --farm-pond-primary: #059669;
    --farm-pond-light: #d1fae5;
    --farm-pond-dark: #047857;
    --dugwell-primary: #7c3aed;
    --dugwell-light: #ede9fe;
    --dugwell-dark: #6d28d9;
    --amrit-sarovar-primary: #0891b2;
    --amrit-sarovar-light: #cffafe;
    --amrit-sarovar-dark: #0e7490;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--jgsa-font-sans);
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    color: var(--jgsa-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container.jgsa-dashboard-page {
    max-width: 1800px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.card {
    background-color: var(--jgsa-bg-card);
    border-radius: var(--jgsa-radius-lg);
    box-shadow: var(--jgsa-shadow-md);
    border: 1px solid var(--jgsa-border-color);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
    box-shadow: var(--jgsa-shadow-lg);
}

/* ==================== HEADER ==================== */
.dashboard-header {
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #2563eb 100%);
    padding: 2rem;
    border-radius: var(--jgsa-radius-xl);
    box-shadow: var(--jgsa-shadow-lg);
    position: relative;
    overflow: hidden;
}

.dashboard-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.header-title-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.header-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--jgsa-radius-xl);
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background: white;
    padding: 4px;
}

.header-text {
    flex: 1;
    color: white;
}

.hindi-title {
    font-family: var(--jgsa-font-hindi);
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}

.dashboard-subtitle.hindi-subtitle {
    font-family: var(--jgsa-font-hindi);
    margin: 0.5rem 0 0;
    font-size: 1.125rem;
    opacity: 0.95;
    font-weight: 500;
}

/* ==================== FILTERS ==================== */
.filters-panel {
    margin-bottom: 2rem;
    overflow: hidden;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid var(--jgsa-border-color);
    cursor: pointer;
}

.filters-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--jgsa-text-primary);
}

.filters-header svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--jgsa-primary-color);
}

.expand-collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--jgsa-radius-full);
    transition: all 0.2s;
}

.expand-collapse-btn:hover {
    background-color: var(--jgsa-primary-light);
    transform: scale(1.1);
}

.expand-collapse-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--jgsa-primary-color);
    transition: transform 0.3s ease;
}

.expand-collapse-btn.collapsed svg {
    transform: rotate(-180deg);
}

.filters-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
}

.filters-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.filter-group label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--jgsa-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.8rem;
    height: 0.8rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234a5568'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    pointer-events: none;
}

.filter-select {
    width: 100%;
    padding: 0.875rem 2.75rem 0.875rem 1.125rem;
    border: 2px solid var(--jgsa-border-color);
    border-radius: var(--jgsa-radius-md);
    background-color: var(--jgsa-bg-card);
    color: var(--jgsa-text-primary);
    font-size: 0.9375rem;
    transition: all 0.2s;
    cursor: pointer;
    appearance: none;
    font-weight: 500;
}

.filter-select:focus {
    outline: none;
    border-color: var(--jgsa-primary-color);
    box-shadow: 0 0 0 3px var(--jgsa-primary-light);
}

.filter-select:disabled {
    background-color: #f8fafc;
    cursor: not-allowed;
    opacity: 0.6;
}

.filter-actions {
    display: flex;
    gap: 1rem;
    grid-column: 1 / -1;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--jgsa-radius-md);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    gap: 0.625rem;
}

.action-button.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: var(--jgsa-shadow-sm);
}

.action-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--jgsa-shadow-md);
}

.action-button.secondary {
    background-color: var(--jgsa-bg-card);
    color: var(--jgsa-primary-color);
    border: 2px solid var(--jgsa-primary-color);
}

.action-button.secondary:hover {
    background-color: var(--jgsa-primary-light);
}

.button-icon {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
}

/* ==================== ERROR MESSAGES ==================== */
.error-message {
    padding: 1.125rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: var(--jgsa-radius-md);
    font-weight: 500;
    font-size: 0.9375rem;
    border: 2px solid;
    display: none;
}

.error-message.is-error {
    background-color: var(--jgsa-error-bg);
    border-color: var(--jgsa-error-border);
    color: var(--jgsa-error-text);
}

.error-message.is-info {
    background-color: var(--jgsa-info-bg);
    border-color: var(--jgsa-info-border);
    color: var(--jgsa-info-text);
}

/* ==================== KPI CARDS ==================== */
.kpi-summary-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.kpi-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: all 0.3s;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--card-color-light) 0%, var(--card-color-dark) 100%);
}

.kpi-card.farm-pond-card {
    --card-color-light: var(--farm-pond-light);
    --card-color-dark: var(--farm-pond-dark);
}

.kpi-card.dugwell-card {
    --card-color-light: var(--dugwell-light);
    --card-color-dark: var(--dugwell-dark);
}

.kpi-card.amrit-sarovar-card {
    --card-color-light: var(--amrit-sarovar-light);
    --card-color-dark: var(--amrit-sarovar-dark);
}

.kpi-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.15), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.kpi-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.kpi-icon {
    width: 4rem;
    height: 4rem;
    border-radius: var(--jgsa-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--jgsa-shadow-md);
    flex-shrink: 0;
}

.kpi-icon svg {
    width: 2rem;
    height: 2rem;
    fill: currentColor;
}

.farmpond-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.dugwell-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.amrit-sarovar-icon {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.kpi-header-text {
    flex: 1;
}

.kpi-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--jgsa-text-primary);
    margin: 0;
    letter-spacing: 0.025em;
}

.kpi-status {
    font-size: 0.8125rem;
    color: var(--jgsa-text-secondary);
    margin: 0.25rem 0 0;
    font-weight: 500;
}

.kpi-main-metric {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.metric-value {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.kpi-value {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--jgsa-text-primary);
    line-height: 1;
    background: linear-gradient(135deg, var(--card-color-dark) 0%, var(--card-color-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.kpi-label-small {
    font-size: 1.125rem;
    color: var(--jgsa-text-secondary);
    font-weight: 600;
}

.progress-bar-container {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background-color: #e2e8f0;
    border-radius: var(--jgsa-radius-full);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    border-radius: var(--jgsa-radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.farm-pond-progress {
    background: linear-gradient(90deg, var(--farm-pond-dark) 0%, var(--farm-pond-primary) 100%);
}

.dugwell-progress {
    background: linear-gradient(90deg, var(--dugwell-dark) 0%, var(--dugwell-primary) 100%);
}

.amrit-sarovar-progress {
    background: linear-gradient(90deg, var(--amrit-sarovar-dark) 0%, var(--amrit-sarovar-primary) 100%);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--jgsa-text-secondary);
}

.progress-percent {
    color: var(--jgsa-text-primary);
    font-size: 1rem;
}

.kpi-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding-top: 1.25rem;
    border-top: 2px dashed var(--jgsa-border-color);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: var(--jgsa-radius-md);
    transition: all 0.2s;
}

.stat-item:hover {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    transform: translateX(4px);
}

.stat-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.kpi-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--jgsa-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--jgsa-text-primary);
}

.kpi-stat-percentage {
    font-size: 0.75rem;
    color: var(--jgsa-secondary-color);
    font-weight: 700;
    margin-left: 0.25rem;
}

/* ==================== CHARTS ==================== */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(550px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-card {
    padding: 2rem;
}

.chart-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--jgsa-border-color);
}

.chart-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--jgsa-text-primary);
}

.chart-subtitle {
    font-size: 0.8125rem;
    color: var(--jgsa-text-secondary);
    margin: 0;
}

.chart-container {
    position: relative;
    height: 350px;
}

/* ==================== DATA TABLE ==================== */
.data-table-wrapper {
    margin-bottom: 2rem;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--jgsa-border-color);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.table-title {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.table-title h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.result-count {
    font-size: 0.8125rem;
    color: var(--jgsa-text-secondary);
    font-weight: 600;
    padding: 0.375rem 0.875rem;
    background-color: var(--jgsa-primary-light);
    border-radius: var(--jgsa-radius-full);
}

.view-search-container {
    position: relative;
    width: 280px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1.125rem;
    border: 2px solid var(--jgsa-border-color);
    border-radius: var(--jgsa-radius-md);
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--jgsa-primary-color);
    box-shadow: 0 0 0 3px var(--jgsa-primary-light);
}

.search-button {
    position: absolute;
    right: 0.375rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--jgsa-text-light);
    border-radius: var(--jgsa-radius-sm);
    transition: all 0.2s;
}

.search-button:hover {
    background-color: var(--jgsa-primary-light);
    color: var(--jgsa-primary-color);
}

.search-button svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
}

.data-table-container {
    padding: 0;
    overflow-x: auto;
    max-height: 700px;
    overflow-y: auto;
    /* Force scrollbar to always be visible to prevent layout shift */
    scrollbar-gutter: stable;
    /* Use overlay scrollbars on supporting browsers */
    overflow: overlay overlay;
}

.table-scroll-wrapper {
    min-width: 100%;
    /* Prevent width changes */
    width: max-content;
}

.data-table-container::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

.data-table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
}

.data-table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
    border: 2px solid #f1f5f9;
}

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

.no-data-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    text-align: center;
    color: var(--jgsa-text-secondary);
}

.no-data-message svg {
    width: 4rem;
    height: 4rem;
    fill: var(--jgsa-text-light);
    margin-bottom: 1.5rem;
}

.jgsa-data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    min-width: max-content;
}

/* Table Headers */
.jgsa-data-table .group-header {
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    font-size: 0.9375rem;
    letter-spacing: 0.075em;
    padding: 1.25rem 1rem;
    text-align: center;
    border-bottom: 3px solid rgba(0, 0, 0, 0.2);
    border-right: 3px solid rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 20;
}

.group-header .header-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.entity-group {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

.farm-pond-group {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.dugwell-group {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.amrit-sarovar-group {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}

.jgsa-data-table .col-header {
    font-weight: 600;
    color: var(--jgsa-text-primary);
    text-transform: uppercase;
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.25rem;
    position: sticky;
    top: 63px;
    z-index: 15;
    border-bottom: 2px solid var(--jgsa-border-color);
    border-right: 2px solid var(--jgsa-border-color);
}

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

.sort-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    opacity: 0.4;
    transition: all 0.2s;
}

.sort-btn:hover {
    opacity: 1;
}

.sort-icon {
    width: 1rem;
    height: 1rem;
    fill: var(--jgsa-text-secondary);
    transition: transform 0.2s;
}

.sort-icon.active {
    opacity: 1;
    fill: var(--jgsa-primary-color);
}

.sort-icon.desc {
    transform: rotate(180deg);
}

/* Column Colors */
.entity-col {
    background-color: #f8fafc;
    border-right: 2px solid #cbd5e1;
}

.farm-pond-col {
    border-right: 2px solid #a7f3d0;
}

.farm-pond-col.col-even {
    background-color: #d1fae5;
}

.farm-pond-col.col-odd {
    background-color: #a7f3d0;
}

.dugwell-col {
    border-right: 2px solid #ddd6fe;
}

.dugwell-col.col-even {
    background-color: #ede9fe;
}

.dugwell-col.col-odd {
    background-color: #ddd6fe;
}

.amrit-sarovar-col {
    border-right: 2px solid #a5f3fc;
}

.amrit-sarovar-col.col-even {
    background-color: #cffafe;
}

.amrit-sarovar-col.col-odd {
    background-color: #a5f3fc;
}

/* Table Body */
.jgsa-data-table tbody tr {
    transition: background-color 0.15s ease;
}

.jgsa-data-table tbody tr:hover td {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 50%, #93c5fd 100%) !important;
    /* Removed transform to prevent wobbling */
}

.jgsa-data-table td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--jgsa-border-color);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
    font-weight: 500;
}

.jgsa-data-table td.number {
    text-align: right;
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.jgsa-data-table td.entity-col:first-child,
.jgsa-data-table th.entity-group {
    position: sticky;
    left: 0;
    z-index: 10;
    font-weight: 700;
    box-shadow: 3px 0 5px rgba(0, 0, 0, 0.1);
}

.jgsa-data-table tbody tr:hover td.entity-col:first-child {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
}

/* ==================== LOADING ==================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(248, 250, 252, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    background-color: white;
    padding: 3rem;
    border-radius: var(--jgsa-radius-xl);
    box-shadow: var(--jgsa-shadow-lg);
}

.spinner {
    width: 4rem;
    height: 4rem;
    border: 0.375rem solid var(--jgsa-primary-light);
    border-radius: 50%;
    border-top-color: var(--jgsa-primary-color);
    animation: spin 1s linear infinite;
}

.spinner-container p {
    font-weight: 600;
    color: var(--jgsa-text-secondary);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== DRILL-DOWN LINKS ==================== */
.drill-down-link {
    color: #2563eb;
    background-color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s;
    position: relative;
    display: inline-block;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

.drill-down-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
    background-color: #eff6ff;
}

.drill-down-link::after {
    content: '→';
    margin-left: 0.375rem;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    transform: translateX(-5px);
}

.drill-down-link:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.clickable-status {
    position: relative;
    transition: all 0.2s ease;
}

.clickable-status:hover {
    background-color: #ffffff !important;
    color: #2563eb !important;
    transform: scale(1.05);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
    border: 1px solid #2563eb;
}

.clickable-status:active {
    transform: scale(0.98);
}

/* ==================== WORK DETAILS MODAL ==================== */
.work-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.work-modal-content {
    background-color: var(--jgsa-bg-card);
    border-radius: var(--jgsa-radius-xl);
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    animation: modalSlideIn 0.3s ease-out;
    /* Optimize rendering and prevent layout shifts */
    will-change: auto;
    contain: layout;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.work-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--jgsa-border-color);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--jgsa-radius-xl) var(--jgsa-radius-xl) 0 0;
}

.work-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--jgsa-text-primary);
}

.work-modal-location {
    margin: 0.5rem 0 0.25rem;
    font-size: 0.9375rem;
    color: var(--jgsa-text-secondary);
    font-weight: 500;
}

.work-modal-date {
    margin: 0.25rem 0;
    font-size: 0.9375rem;
    color: #2563eb;
    font-weight: 600;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--jgsa-radius-sm);
}

.work-modal-subtitle {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: var(--jgsa-text-light);
    font-weight: 500;
    font-style: italic;
}

.work-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border: 2px solid var(--jgsa-border-color);
    border-radius: var(--jgsa-radius-md);
    padding: 1rem 1.25rem;
    text-align: center;
    transition: all 0.2s;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--jgsa-shadow-md);
}

.summary-label {
    font-size: 0.8125rem;
    color: var(--jgsa-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--jgsa-text-primary);
    margin-bottom: 0.25rem;
}

.summary-note {
    font-size: 0.6875rem;
    color: var(--jgsa-text-light);
    font-weight: 500;
    text-transform: none;
    font-style: italic;
}

.work-status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--jgsa-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.work-modal-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.work-modal-download {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.625rem 1.25rem;
    border-radius: var(--jgsa-radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.3);
}

.work-modal-download:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.4);
}

.work-modal-download:active {
    transform: translateY(0);
}

.work-modal-download svg {
    flex-shrink: 0;
}

.work-modal-close {
    background: none;
    border: none;
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--jgsa-text-light);
    cursor: pointer;
    padding: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--jgsa-radius-full);
    transition: all 0.2s;
    line-height: 1;
    flex-shrink: 0;
}

.work-modal-close:hover {
    background-color: var(--jgsa-error-bg);
    color: var(--jgsa-error-text);
    transform: rotate(90deg);
}

.work-modal-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
    /* Prevent scrollbar layout shift */
    scrollbar-gutter: stable;
    /* Use overlay scrollbars on supporting browsers */
    overflow: overlay;
}

.work-table-wrapper {
    overflow-x: auto;
    margin-bottom: 1rem;
    /* Prevent width changes */
    width: 100%;
    /* Stable scrollbar area */
    scrollbar-gutter: stable;
}

/* Custom scrollbar for modal - Thin and stable */
.work-modal-body::-webkit-scrollbar,
.work-table-wrapper::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.work-modal-body::-webkit-scrollbar-track,
.work-table-wrapper::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.work-modal-body::-webkit-scrollbar-thumb,
.work-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5);
    border-radius: 3px;
    transition: background-color 0.2s;
}

.work-modal-body::-webkit-scrollbar-thumb:hover,
.work-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.8);
}

/* Firefox scrollbar styling */
.work-modal-body,
.work-table-wrapper {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.5) transparent;
}

.work-details-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    /* Prevent table from causing width shifts */
    table-layout: auto;
}

.work-details-table thead th {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

.work-details-table thead th:first-child {
    border-radius: var(--jgsa-radius-md) 0 0 0;
}

.work-details-table thead th:last-child {
    border-radius: 0 var(--jgsa-radius-md) 0 0;
}

.work-details-table tbody tr {
    transition: background-color 0.15s ease;
}

.work-details-table tbody tr:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    /* Removed transform to prevent wobbling */
}

.work-details-table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--jgsa-border-color);
    vertical-align: middle;
}

.work-details-table tbody tr.even-row {
    background-color: #f9fafb;
}

.work-details-table tbody tr.odd-row {
    background-color: white;
}

.work-details-table .work-code {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--jgsa-primary-color);
}

.work-details-table .work-name {
    max-width: 300px;
    word-wrap: break-word;
}

.work-details-table .number {
    text-align: right;
    font-weight: 600;
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
}

.no-works-message {
    text-align: center;
    padding: 3rem;
    color: var(--jgsa-text-secondary);
    font-size: 1.125rem;
}

.work-count-summary {
    text-align: right;
    font-weight: 700;
    color: var(--jgsa-text-primary);
    margin: 1rem 0 0;
    font-size: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: var(--jgsa-radius-md);
}

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

@media (max-width: 768px) {
    .container.jgsa-dashboard-page {
        padding: 0;
        margin: 0.5rem auto;
        max-width: 100%;
        width: 100%;
    }

    .dashboard-header {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }

    .header-title-section {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .header-logo {
        width: 60px;
        height: 60px;
    }

    .hindi-title {
        font-size: 1.75rem;
    }

    .dashboard-subtitle.hindi-subtitle {
        font-size: 0.9375rem;
    }

    .filters-section {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        gap: 1.25rem;
    }

    .filter-actions {
        flex-direction: column;
    }

    .action-button {
        width: 100%;
    }

    .kpi-summary-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .kpi-card {
        padding: 1.5rem;
    }

    .kpi-icon {
        width: 3.5rem;
        height: 3.5rem;
    }

    .kpi-icon svg {
        width: 1.75rem;
        height: 1.75rem;
    }

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

    .kpi-label-small {
        font-size: 1rem;
    }

    .kpi-stats-grid {
        grid-template-columns: 1fr;
    }

    .charts-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .chart-card {
        padding: 1.5rem;
    }

    .chart-container {
        height: 300px;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.25rem;
    }

    .view-search-container {
        width: 100%;
    }

    .jgsa-data-table {
        font-size: 0.6875rem;
    }

    .jgsa-data-table td,
    .jgsa-data-table th {
        padding: 0.5rem 0.625rem;
    }

    .group-header {
        font-size: 0.6875rem;
        padding: 0.75rem 0.5rem;
    }

    .col-header {
        font-size: 0.625rem;
        padding: 0.75rem 0.5rem;
        top: 50px;
    }

    .work-modal-content {
        width: 100%;
        max-height: 95vh;
        border-radius: var(--jgsa-radius-md);
    }

    .work-modal-header {
        padding: 1rem 1.25rem;
    }

    .work-modal-header h2 {
        font-size: 1.125rem;
    }

    .work-modal-body {
        padding: 1rem 1.25rem;
    }

    .work-details-table {
        font-size: 0.75rem;
    }

    .work-details-table thead th {
        padding: 0.75rem 0.625rem;
        font-size: 0.6875rem;
    }

    .work-details-table tbody td {
        padding: 0.625rem 0.5rem;
    }

    .drill-down-link {
        font-size: 0.75rem;
    }

    .work-summary-cards {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .summary-card {
        padding: 0.75rem 1rem;
    }

    .summary-label {
        font-size: 0.6875rem;
        margin-bottom: 0.375rem;
    }

    .summary-value {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .hindi-title {
        font-size: 1.5rem;
    }

    .dashboard-subtitle.hindi-subtitle {
        font-size: 0.875rem;
    }

    .filters-section {
        padding: 1rem;
    }

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

    .stat-item {
        padding: 0.75rem;
    }

    .stat-icon {
        font-size: 1.25rem;
    }
}

/* ==================== CHANGE INDICATORS ==================== */
.change-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--jgsa-radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.change-indicator.positive {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #047857;
}

.change-indicator.negative {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.change-indicator.neutral {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #6b7280;
}

.change-arrow {
    font-size: 0.875rem;
    font-weight: bold;
}

.change-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.change-absolute {
    font-weight: 700;
}

.change-percent {
    font-size: 0.6875rem;
    opacity: 0.9;
}

.kpi-value-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ==================== PROGRESS HISTORY CHART ==================== */
.progress-history-section {
    margin-bottom: 2rem;
}

.history-chart-card {
    padding: 2rem;
}

.history-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--jgsa-border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.history-chart-title-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--jgsa-text-primary);
}

.history-chart-subtitle {
    font-size: 0.8125rem;
    color: var(--jgsa-text-secondary);
    margin: 0;
}

.time-period-selector {
    display: flex;
    gap: 0.5rem;
    background: var(--jgsa-bg-page);
    padding: 0.375rem;
    border-radius: var(--jgsa-radius-md);
    border: 2px solid var(--jgsa-border-color);
}

.time-period-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--jgsa-text-secondary);
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    border-radius: var(--jgsa-radius-sm);
    transition: all 0.2s;
    white-space: nowrap;
}

.time-period-btn:hover {
    background: var(--jgsa-primary-light);
    color: var(--jgsa-primary-color);
}

.time-period-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: var(--jgsa-shadow-sm);
}

.history-chart-container {
    position: relative;
    height: 320px;
}

/* ==================== RESPONSIVE UPDATES ==================== */
@media (max-width: 768px) {
    .change-indicator {
        font-size: 0.6875rem;
        padding: 0.1875rem 0.5rem;
        margin-left: 0.25rem;
    }
    
    .change-arrow {
        font-size: 0.75rem;
    }
    
    .kpi-value-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .history-chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .time-period-selector {
        width: 100%;
        justify-content: space-between;
    }
    
    .time-period-btn {
        flex: 1;
        padding: 0.625rem 0.75rem;
    }
    
    .history-chart-container {
        height: 280px;
    }
}

@media (max-width: 480px) {
    .change-indicator {
        font-size: 0.625rem;
        padding: 0.125rem 0.375rem;
    }
    
    .time-period-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.625rem;
    }
}

/* ==================== CHANGE INDICATORS ==================== */
.change-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--jgsa-radius-sm);
    font-size: 0.8125rem;
    font-weight: 700;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.change-indicator.positive {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #047857;
}

.change-indicator.negative {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.change-indicator.neutral {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #6b7280;
}

.change-arrow {
    font-size: 1rem;
    font-weight: bold;
}

.kpi-value-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Visitor Counter Footer - Subtle Design */
.visitor-footer {
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 12px 0;
    margin-top: 60px;
    text-align: center;
}

.visitor-counter-subtle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--jgsa-font-sans);
    font-size: 12px;
    color: var(--jgsa-text-light);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.visitor-counter-subtle:hover {
    opacity: 1;
}

.visitor-icon-subtle {
    width: 16px;
    height: 16px;
    fill: var(--jgsa-text-light);
    opacity: 0.6;
}

.visitor-text-subtle {
    font-weight: 400;
    letter-spacing: 0.3px;
}

.visitor-text-subtle #visitorCount {
    font-weight: 600;
    color: var(--jgsa-text-secondary);
    margin-left: 2px;
}

/* Responsive design for visitor counter */
@media (max-width: 768px) {
    .visitor-footer {
        padding: 10px 0;
        margin-top: 40px;
    }

    .visitor-counter-subtle {
        font-size: 11px;
    }

    .visitor-icon-subtle {
        width: 14px;
        height: 14px;
    }
}

/* Rest of CSS remains the same... */