/* ============================================
   index.css — Page-specific styles for index.html
   Shared styles are in styles.css
   ============================================ */

/* === Index-only tone (Medium scope) ===
   Solid dark green text (no animation on text), gradient + animation only on
   logo-like featured elements (profile avatar, Quick Action icons). */
:root {
    --jjr-lime: #a1df2a;
    --jjr-green: #07a960;
    --jjr-gradient-card: linear-gradient(135deg, #a1df2a 0%, #07a960 100%);
}

@keyframes jjrAvatarShine {
    from { background-position: 0% 50%; }
    to   { background-position: 100% 50%; }
}

/* Solid dark green for index headings (no animation) */
.page-title {
    color: var(--primary-green-darker);
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: var(--primary-green-darker);
    animation: none;
}

.section-title,
.subsection-title {
    color: var(--primary-green-darker);
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: var(--primary-green-darker);
    animation: none;
}

/* Date filter accent — dark green */
.date-filter-input:focus {
    border-color: var(--primary-green-dark) !important;
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.15) !important;
}

.date-filter-label i {
    color: var(--primary-green-dark);
}

/* View All button — solid dark green (no animation) */
.view-all-btn {
    background: linear-gradient(135deg, var(--primary-green-dark), var(--primary-green-darker)) !important;
    box-shadow: 0 3px 8px rgba(4, 120, 87, 0.20) !important;
}

/* === Quick Actions Section === */
.quick-actions-section {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f4f0;
}

.qa-header {
    margin-bottom: 20px;
}

.qa-title {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--primary-green-darker);
    margin: 0;
    display: inline-block;
}

.qa-title i {
    color: var(--primary-green-dark);
    margin-right: 6px;
}

.qa-subtitle {
    font-size: 0.85em;
    color: var(--text-light);
    margin-top: 4px;
}

.qa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.qa-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 22px 16px;
    border-radius: 12px;
    background: var(--white);
    border: 1px solid #e8efe8;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.qa-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--jjr-gradient-card);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.qa-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(7, 169, 96, 0.12);
    border-color: var(--jjr-lime);
}

.qa-card:hover::before {
    transform: scaleX(1);
}

.qa-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: var(--jjr-gradient-card);
    background-size: 200% 200%;
    animation: jjrAvatarShine 5s ease-in-out infinite alternate;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 4px 14px rgba(7, 169, 96, 0.22);
    transition: transform 0.25s ease;
}

.qa-card:hover .qa-icon {
    transform: scale(1.05) rotate(-3deg);
}

.qa-icon i {
    color: #fff;
    font-size: 1.45em;
}

.qa-label {
    font-weight: 600;
    font-size: 1em;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.qa-desc {
    font-size: 0.78em;
    color: var(--text-light);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .qa-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    .qa-card { padding: 16px 10px; }
}

@media (max-width: 480px) {
    .quick-actions-section { padding: 18px 14px; }
    .qa-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .qa-card { padding: 14px 8px; }
    .qa-icon { width: 46px; height: 46px; border-radius: 12px; }
    .qa-icon i { font-size: 1.25em; }
    .qa-label { font-size: 0.92em; }
    .qa-desc { display: none; }
}

/* Body override for index page */
body {
    min-height: 100vh;
}

/* Sidebar Profile (index-only, hidden on mobile via styles.css) */
.sidebar-profile {
    padding: 20px;
    border-top: 1px solid var(--grey-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Profile dropdown styles are injected at runtime by JJRProfileDropdown.install()
   in script.js (v2.6.x). Shared profile-avatar/info/name/role styles live in styles.css.
   The legacy rules that lived here from before v2.6.0 anchored the menu with
   bottom:100% and overrode min-width/z-index — they conflicted with the new injected
   rules and broke the dropdown on index.html. Removed. */

/* Date Filter */
.date-filter-section {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--grey-border);
    margin-bottom: 30px;
}

.date-filter-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-filter-label {
    font-weight: 500;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-filter-input {
    padding: 8px 12px;
    border: 1px solid var(--grey-border);
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 0.95em;
    background: var(--white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.date-filter-input:focus {
    outline: none;
    border-color: var(--primary-green-dark);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Latest Items Section */
.latest-section {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--grey-border);
}

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

.section-title {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-dark);
}

.section-subtitle {
    font-size: 0.85em;
    color: var(--text-light);
    margin-top: 5px;
}

.view-all-btn {
    background: var(--gradient-button);
    color: var(--white);
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.view-all-btn:hover {
    background: var(--gradient-button-hover);
    transform: translateY(-1px);
}

/* Table */
.items-table {
    width: 100%;
    border-collapse: collapse;
}

.items-table thead { background: var(--grey-light); }

.items-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9em;
    border-bottom: 2px solid var(--grey-border);
}

.items-table td {
    padding: 15px;
    border-bottom: 1px solid var(--grey-border);
    font-size: 0.9em;
}

.items-table tbody tr { transition: background-color 0.2s ease; }
.items-table tbody tr:hover { background: rgba(16, 185, 129, 0.03); }

.ticket-id {
    color: var(--primary-green-dark);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.ticket-id:hover { text-decoration: underline; }

.problem-topic { display: flex; align-items: center; gap: 8px; }

.topic-tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.tag-printer { background: #e3f2fd; color: #1976d2; }
.tag-hardware { background: #fff3e0; color: #f57c00; }
.tag-software { background: #f3e5f5; color: #7b1fa2; }
.tag-network { background: #e8f5e9; color: #388e3c; }

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-button);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 0.85em;
    margin-right: 8px;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    white-space: nowrap;
}

.badge-pending { background: rgba(255, 193, 7, 0.15); color: #f57c00; }
.badge-in-progress { background: rgba(59, 130, 246, 0.15); color: #1976d2; }
.badge-approved { background: rgba(139, 92, 246, 0.15); color: #7b1fa2; }
.badge-completed { background: rgba(16, 185, 129, 0.15); color: #047857; }

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

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--grey-light);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-medium);
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--primary-green-bright);
    color: var(--white);
}

.loading-message {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.loading-message i.fa-spinner,
.loading-message i.fa-sync-alt {
    animation: spin 1s linear infinite;
}

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

.empty-message {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* Chat Executive Dashboard Section */
.chat-dashboard-section {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 30px;
    color: white;
}

.chat-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-dashboard-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2em;
    font-weight: 600;
}

.chat-dashboard-title i { color: #0084ff; font-size: 1.2em; }

.chat-dashboard-link {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85em;
    transition: all 0.2s;
}

.chat-dashboard-link:hover { background: rgba(255, 255, 255, 0.2); }

/* Quick Stats (Chat Dashboard) */
.chat-quick-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.quick-stat {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
}

.quick-stat-icon.blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.quick-stat-icon.yellow { background: rgba(234, 179, 8, 0.2); color: #fbbf24; }
.quick-stat-icon.red { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.quick-stat-value { font-size: 1.8em; font-weight: 700; line-height: 1; }
.quick-stat-label { font-size: 0.8em; color: rgba(255, 255, 255, 0.6); margin-top: 4px; }

/* Dashboard Grid */
.chat-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.chat-dashboard-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.card-header i { color: #10b981; }

/* Sentiment Bars */
.sentiment-bars { display: flex; flex-direction: column; gap: 12px; }
.sentiment-bar-row { display: flex; align-items: center; gap: 10px; }
.sentiment-label-text { width: 70px; font-size: 0.85em; }

.sentiment-bar-track {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

.sentiment-bar-fill { height: 100%; border-radius: 5px; transition: width 0.5s ease; }
.sentiment-bar-fill.positive { background: linear-gradient(90deg, #22c55e, #4ade80); }
.sentiment-bar-fill.neutral { background: linear-gradient(90deg, #6b7280, #9ca3af); }
.sentiment-bar-fill.negative { background: linear-gradient(90deg, #ef4444, #f87171); }
.sentiment-percent { width: 45px; text-align: right; font-size: 0.85em; font-weight: 600; }

/* Top Lists */
.top-list { display: flex; flex-direction: column; gap: 8px; }

.top-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.top-list-rank {
    width: 24px; height: 24px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75em; font-weight: 700;
    background: rgba(16, 185, 129, 0.2); color: #34d399;
}

.top-list-rank.gold { background: rgba(234, 179, 8, 0.2); color: #fbbf24; }
.top-list-rank.silver { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }
.top-list-rank.bronze { background: rgba(249, 115, 22, 0.2); color: #fb923c; }

.top-list-name {
    flex: 1; font-size: 0.85em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.top-list-count { font-size: 0.8em; color: rgba(255, 255, 255, 0.6); }
.top-list-empty { text-align: center; padding: 20px; color: rgba(255, 255, 255, 0.4); font-size: 0.85em; }

/* Sales Dashboard Section */
.sales-dashboard {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.sales-chart-section {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--grey-border);
}

.sales-stats-section { display: flex; flex-direction: column; gap: 20px; }

.sales-stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--grey-border);
}

.sales-stat-label { font-size: 0.85em; color: var(--text-medium); margin-bottom: 8px; }
.sales-stat-value { font-size: 1.8em; font-weight: 700; color: var(--primary-green-darker); }

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

.top-products-section {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--grey-border);
    margin-bottom: 30px;
}

.top-products-list { margin-top: 20px; }

.sales-analytics-content {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    align-items: flex-start;
}

.districts-table-wrapper { flex: 0 0 40%; min-width: 0; }

.subsection-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.chart-wrapper { flex: 0 0 60%; position: relative; min-width: 0; }

.districts-table { width: 100%; border-collapse: collapse; background: var(--white); }
.districts-table thead { background: var(--grey-light); }

.districts-table th {
    padding: 12px 15px; text-align: left; font-weight: 600;
    color: var(--text-dark); font-size: 0.9em;
    border-bottom: 2px solid var(--grey-border);
}

.districts-table td {
    padding: 12px 15px; border-bottom: 1px solid var(--grey-border);
    font-size: 0.9em; color: var(--text-dark);
}

.districts-table tbody tr { transition: background-color 0.2s ease; }
.districts-table tbody tr:hover { background: rgba(16, 185, 129, 0.03); }
.districts-table tbody tr:last-child td { border-bottom: none; }
.top-locations-list { margin-top: 20px; }

.map-wrapper {
    position: relative; height: 500px; margin-top: 20px;
    border-radius: 8px; overflow: hidden;
    border: 1px solid var(--grey-border);
}

#locationMap { width: 100%; height: 100%; }

.map-legend {
    position: absolute; bottom: 20px; right: 20px;
    background: rgba(255, 255, 255, 0.95); padding: 15px;
    border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000; max-width: 250px;
}

.legend-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.85em; }
.legend-item:last-child { margin-bottom: 0; }
.legend-color { width: 20px; height: 20px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.2); }

/* Update Overlay */
.update-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.75); backdrop-filter: blur(5px);
    z-index: 9999; display: none; justify-content: center;
    align-items: center; text-align: center; padding: 20px;
}

.update-box {
    background: var(--white); padding: 30px 40px;
    border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 500px; animation: fadeInScaleUp 0.5s ease-out;
}

.update-box h2 {
    font-size: 1.6em; font-weight: 600; color: var(--primary-green-darker);
    margin-top: 0; margin-bottom: 15px;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}

/* Version Footer */
.version-footer {
    text-align: center; padding: 10px 15px; color: var(--text-light);
    font-size: 0.85em; position: fixed; bottom: 0; left: 280px; right: 0;
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    border-top: 1px solid rgba(0, 0, 0, 0.05); z-index: 10;
}

/* Quick Stats Grid */
.quick-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.quick-stat-card {
    background: var(--white); border-radius: 12px; padding: 20px;
    display: flex; align-items: center; gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--grey-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.qs-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.2em; flex-shrink: 0;
}

.qs-info { flex: 1; }
.qs-label { font-size: 0.82em; color: var(--text-light); margin-bottom: 4px; }
.qs-value { font-size: 1.4em; font-weight: 700; color: var(--text-dark); line-height: 1.2; }
.qs-value small { font-size: 0.55em; font-weight: 400; color: var(--text-light); }

/* Repair Widget */
.repair-widget {
    background: var(--white); border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--grey-border);
    margin-bottom: 24px; overflow: hidden;
}

.rw-header {
    padding: 16px 20px; display: flex; align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--grey-border);
}

.rw-title {
    font-weight: 600; color: var(--text-dark); font-size: 1em;
    display: flex; align-items: center; gap: 8px;
}

.rw-title i { color: var(--primary-green-dark); }

.rw-count-badge {
    background: var(--error-red); color: #fff;
    font-size: 0.75em; font-weight: 700;
    padding: 3px 10px; border-radius: 20px;
    min-width: 24px; text-align: center;
}

.rw-body { padding: 0; }

.rw-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px; border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: background 0.15s ease;
}

.rw-item:hover { background: rgba(16, 185, 129, 0.03); }
.rw-item-left { display: flex; align-items: center; gap: 10px; }
.rw-case-id { font-weight: 600; color: var(--primary-green-dark); font-size: 0.85em; }
.rw-name { color: var(--text-dark); font-size: 0.9em; }
.rw-item-right { display: flex; align-items: center; gap: 10px; }

.rw-status-badge {
    font-size: 0.72em; padding: 3px 8px;
    border-radius: 12px; font-weight: 500;
}

.rw-date { font-size: 0.78em; color: var(--text-light); }
.rw-empty { text-align: center; padding: 24px; color: var(--text-light); font-size: 0.9em; }
.rw-empty i { margin-right: 6px; color: var(--success-green); }

.rw-more, .rw-footer-link {
    display: block; text-align: center; padding: 12px;
    color: var(--primary-green-dark); font-size: 0.85em;
    text-decoration: none; font-weight: 500;
    border-top: 1px solid var(--grey-border);
    transition: background 0.15s ease;
}

.rw-footer-link:hover { background: rgba(16, 185, 129, 0.05); }
.rw-more a { color: var(--primary-green-dark); text-decoration: none; }

/* Skeleton Loading */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-line {
    height: 14px; border-radius: 6px;
    background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    margin-bottom: 8px;
}

.skeleton-line.big { height: 28px; margin-top: 6px; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w50 { width: 50%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w70 { width: 70%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w90 { width: 90%; }
.skeleton-line.w100 { width: 100%; }
.skeleton-card { flex-direction: column; align-items: flex-start; }

.skeleton-chart {
    display: flex; justify-content: center; align-items: center; height: 200px;
}

.skeleton-circle {
    width: 150px; height: 150px; border-radius: 50%;
    background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-table { padding: 10px 0; }
.skeleton-table .skeleton-line { margin-bottom: 12px; }

.rw-skeleton-item {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

/* What's New Popup (index-specific) */
.popup-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
    z-index: 20000; display: none;
    justify-content: center; align-items: center; padding: 20px;
}

.popup-overlay.show { display: flex; }

.popup-box {
    background: var(--white); border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px; width: 100%; padding: 30px;
    animation: popupSlideIn 0.3s ease;
}

@keyframes popupSlideIn {
    from { opacity: 0; transform: scale(0.9) translateY(-20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.popup-box h2 {
    color: var(--primary-green-darker); font-size: 1.4em;
    margin-bottom: 20px; text-align: center; line-height: 1.4;
}

.popup-box ul { list-style: none; padding: 0; margin: 0 0 25px 0; }

.popup-box ul li {
    padding: 10px 12px; background: var(--grey-light);
    border-radius: 8px; margin-bottom: 8px; font-size: 0.95em;
    color: var(--text-dark); border-left: 3px solid var(--primary-green-bright);
}

.popup-button {
    display: block; width: 100%; padding: 14px;
    background: var(--gradient-button); color: var(--white);
    border: none; border-radius: 10px;
    font-size: 1.05em; font-weight: 600;
    font-family: var(--font-family); cursor: pointer;
    transition: all 0.3s ease;
}

.popup-button:hover {
    background: var(--gradient-button-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* ============================================
   Responsive — index-specific overrides
   ============================================ */

@media (max-width: 1024px) {
    .chat-dashboard-grid { grid-template-columns: 1fr; }
    .version-footer { left: 0; }
    .sidebar-profile { display: none; }
    .sales-dashboard { grid-template-columns: 1fr; }
    .top-products-section { grid-template-columns: 1fr; }
    .sales-analytics-content { flex-direction: column; }
    .districts-table-wrapper, .chart-wrapper { flex: 1; width: 100%; }
}

@media (max-width: 768px) {
    .date-filter-section { padding: 15px; }
    .date-filter-wrapper { flex-direction: column; align-items: flex-start; gap: 10px; }
    .date-filter-label { font-size: 0.9em; }
    .top-products-section { padding: 15px; }
    .section-title { font-size: 1.1em; }
    .subsection-title { font-size: 1em; }
    .districts-table { font-size: 0.85em; }
    .districts-table th, .districts-table td { padding: 8px 10px; }
    .chart-container { height: 300px; }
    .chat-dashboard-section { padding: 15px; }
    .chat-quick-stats { flex-direction: column; }
    .quick-stat { min-width: 100%; }
    .chat-dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .date-filter-section { padding: 12px; }
    .top-products-section { padding: 12px; }
    .districts-table { font-size: 0.8em; }
    .districts-table th, .districts-table td { padding: 6px 8px; }
}
