      
      
      
      
      * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --primary-color: #2563eb;
            --secondary-color: #1e40af;
            --accent-color: #3b82f6;
            --text-dark: #1f2937;
            --text-light: #6b7280;
            --bg-light: #373636;
            --bg-white: #000000;
            --bg-body: #27203a;
            --bg-nav: #0000003d;
            --border-color: #e9d7d7;
            --text-nav-links: #e9d7d7;
            --background-nav-links: rgba(255, 251, 251, 0.2);
            --border-nav-links: #ffffff;
            --user-dropdown-color: #716060;
            --text-mobile-menu-btn: #ffffff;
            --nav-links: #222020;
        }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}

        /* Navigation */
        nav {
            background-color: var(--bg-nav);
            box-shadow: 0 1px 3px rgb(61, 58, 58);
            position: sticky;
            top: 0;
            z-index: 1000;
        }

        .nav-container {
            max-width: 1600px;
            margin: 0;
                list-style: none;
            padding: 0px 0px;
  display: flex;           /* viktig */
            justify-content: space-between;
            align-items: center;
        }

        .logo {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary-color);
            text-decoration: none;
            display: flex;
            align-items: left;
            gap: 0.5rem;
        }

        .logo-img {
            width: 40px;
            height: 35px;
            object-fit: contain;
            display: block;
        }

        .nav-links {
            display: flex;
            gap: 0.9rem;
            list-style: none;
        }

        .nav-links a {
            text-decoration: none;
            color: var(--text-nav-links);
            font-weight: 390;
            transition: color 0.3s;
            display: inline-block;        /* VIKTIG */
            background-color: var(--background-nav-links);
            border: var(--border-nav-links);
                    border-radius: 6px;
padding: 2px 6px;
        }

        .nav-links a:hover {
            color: var(--primary-color);
        }

        .user-dropdown {
            position: relative;
        }

        .user-dropdown-toggle {
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 8px 16px;
            background: var(--user-dropdown-color);
            color: rgb(61, 57, 57);
            border-radius: 6px;
            font-weight: 500;
        }

        .user-dropdown-toggle:hover {
            background: var(--secondary-color);
        }

        .dropdown-arrow {
            font-size: 0.8rem;
            transition: transform 0.2s;
        }

        .user-dropdown.active .dropdown-arrow {
            transform: rotate(180deg);
        }

        .dropdown-menu {
            position: absolute;
            top: calc(100% + 0.5rem);
            right: 0;
            background: rgb(40, 37, 37);
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            min-width: 180px;
            display: none;
            z-index: 1000;
        }

        .user-dropdown.active .dropdown-menu {
            display: block;
        }

        .dropdown-menu a {
            display: block;
            padding: 0.75rem 1.25rem;
            color: var(--text-dark);
            text-decoration: none;
            transition: 0.2s;
        }

        .dropdown-menu a:hover {
            background: var(--bg-light);
        }

        .dropdown-menu .logout-link {
            border-top: 1px solid var(--border-color);
            color: #e74c3c;
        }

        .dropdown-menu .logout-link:hover {
            background: #fee;
        }

        .mobile-menu-btn {
            display: none;
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--text-dark);
        }

                    .mobile-menu-btn {
                display: block;
            }


        .container {
            max-width: 1000px;
            margin: 0 auto;
        }

        .header {
            background: rgba(255, 255, 255, 0.09);
            backdrop-filter: blur(15px);
            -webkit-backdrop-filter: blur(15px);
            border-radius: 16px;
            padding: 30px;
            margin-bottom: 20px;
            border: 1px solid rgba(255, 255, 255, 0.3);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
            color: #ffffff;
        }

        .header h1 {
            color: #ffffff;
            margin-bottom: 10px;
        }

        .header .user-email {
            color: rgba(255, 255, 255, 0.7);
            font-size: 0.9rem;
        }

        .nav-links a:hover {
            background: #f0f0f0;
        }

        .card {
            background: rgba(255, 255, 255, 0.09);
            backdrop-filter: blur(15px);
            -webkit-backdrop-filter: blur(15px);
            border-radius: 16px;
            padding: 30px;
            margin-bottom: 20px;
            border: 1px solid rgba(255, 255, 255, 0.3);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
            color: #ffffff;
        }

        .card h2 {
            color: #ffffff;
            margin-bottom: 20px;
            font-size: 1.5rem;
        }

        .form-group {
            margin-bottom: 20px;
        }

        label {
            display: block;
            margin-bottom: 8px;
            color: rgba(255, 255, 255, 0.8);
            font-weight: 500;
            font-size: 0.9rem;
        }

        input {
            width: 100%;
            padding: 12px 15px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            font-size: 1rem;
            transition: border-color 0.3s;
            background: rgba(255, 255, 255, 0.1);
            color: #ffffff;
        }

        input:focus {
            outline: none;
            border-color: #667eea;
        }

        input:disabled {
            background: rgba(255, 255, 255, 0.05);
            color: rgba(255, 255, 255, 0.5);
            cursor: not-allowed;
        }

        .btn {
            padding: 12px 24px;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }

        .btn-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
        }

        .btn-secondary {
            background: #e0e0e0;
            color: #333;
        }

        .btn-secondary:hover {
            background: #d0d0d0;
        }

        .btn-danger {
            background: #e74c3c;
            color: white;
        }

        .btn-danger:hover {
            background: #c0392b;
        }

        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .message {
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 20px;
            display: none;
        }

        .message.show {
            display: block;
        }

        .message.success {
            background: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }

        .message.error {
            background: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }

        .stat-card {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 20px;
            border-radius: 12px;
            text-align: center;
        }

        .currency-points {
            background: linear-gradient(135deg, #9b59b6 0%, #6c3483 100%);
        }

        .currency-coins {
            background: linear-gradient(135deg, #f39c12 0%, #d68910 100%);
        }

        .currency-points-spent {
            background: linear-gradient(135deg, #7d3c98 0%, #4a235a 100%);
        }

        .currency-coins-spent {
            background: linear-gradient(135deg, #ca8a04 0%, #92620f 100%);
        }

        .stat-card .value {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 5px;
        }

        .stat-card .label {
            font-size: 0.9rem;
            opacity: 0.9;
        }

        .divider {
            height: 1px;
            background: #e0e0e0;
            margin: 30px 0;
        }

        .danger-zone {
            border: 2px solid #e74c3c;
            border-radius: 12px;
            padding: 20px;
            margin-top: 20px;
        }

        .danger-zone h3 {
            color: #e74c3c;
            margin-bottom: 10px;
        }

        .danger-zone p {
            color: rgba(255, 255, 255, 0.7);
            margin-bottom: 15px;
        }

        /* Date Filter Styles */
        .filter-controls {
            display: flex;
            gap: 15px;
            align-items: flex-end;
            margin-bottom: 15px;
            flex-wrap: wrap;
        }

        .filter-group {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .filter-group label {
            font-size: 0.85rem;
            color: rgba(255, 255, 255, 0.7);
            margin-bottom: 0;
        }

        .date-input {
            padding: 8px 12px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 6px;
            font-size: 0.9rem;
            background: rgba(255, 255, 255, 0.1);
            color: #ffffff;
        }

        .date-input:focus {
            outline: none;
            border-color: #667eea;
        }

        .btn-small {
            padding: 8px 16px;
            font-size: 0.9rem;
        }

        /* Quick Period Buttons */
        .quick-periods {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .period-btn {
            padding: 8px 16px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            background: rgba(255, 255, 255, 0.1);
            color: #ffffff;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.3s;
        }

        .period-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            border-color: #667eea;
        }

        .period-btn.active {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border-color: #667eea;
        }

        /* Statistics Table */
        .table-container {
            overflow-x: auto;
            margin-top: 15px;
        }

        .stats-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.9rem;
        }

        .stats-table th {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 12px;
            text-align: left;
            font-weight: 600;
        }

        .stats-table td {
            padding: 12px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .stats-table tr:hover {
            background: rgba(255, 255, 255, 0.05);
        }

        .stats-table tr:last-child td {
            border-bottom: none;
        }

        .table-pagination {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            padding: 12px 0 4px;
        }

        .page-indicator {
            font-size: 13px;
            color: rgba(255,255,255,0.55);
            min-width: 160px;
            text-align: center;
        }

        .accuracy-good {
            color: #27ae60;
            font-weight: 600;
        }

        .accuracy-medium {
            color: #f39c12;
            font-weight: 600;
        }

        .accuracy-poor {
            color: #e74c3c;
            font-weight: 600;
        }

        /* Activation Key Styles */
        .status-badge {
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 0.85rem;
            font-weight: 600;
            display: inline-block;
        }

        .status-active {
            background: #d4edda;
            color: #155724;
        }

        .status-revoked {
            background: #f8d7da;
            color: #721c24;
        }

        .key-value {
            font-family: 'Courier New', monospace;
            font-size: 0.9rem;
            background: rgba(255, 255, 255, 0.1);
            padding: 4px 8px;
            border-radius: 4px;
            color: #ffffff;
        }

        .device-id {
            font-family: 'Courier New', monospace;
            font-size: 0.85rem;
            color: rgba(255, 255, 255, 0.6);
        }

        /* Clickable rows */
        .stats-table tbody tr {
            cursor: pointer;
        }

        /* Detail Modal */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        .modal-overlay.show {
            display: flex;
        }

        .modal-content {
            background: rgba(30, 41, 59, 0.95);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 16px;
            padding: 30px;
            max-width: 700px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
            color: #ffffff;
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .modal-header h3 {
            color: #ffffff;
            margin: 0;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: rgba(255, 255, 255, 0.6);
        }

        .modal-close:hover {
            color: #ffffff;
        }

        .detail-section {
            margin-bottom: 25px;
        }

        .detail-section h4 {
            color: #667eea;
            margin-bottom: 12px;
            font-size: 1rem;
            border-bottom: 2px solid #667eea;
            padding-bottom: 5px;
        }

        .detail-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 10px;
        }

        .detail-item {
            background: rgba(255, 255, 255, 0.1);
            padding: 10px 15px;
            border-radius: 8px;
        }

        .detail-item .label {
            font-size: 0.8rem;
            color: rgba(255, 255, 255, 0.6);
            margin-bottom: 3px;
        }

        .detail-item .value {
            font-weight: 600;
            color: #ffffff;
        }

        .mistakes-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.9rem;
            margin-top: 10px;
        }

        .mistakes-table th {
            background: rgba(255, 255, 255, 0.1);
            padding: 8px 12px;
            text-align: left;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.8);
        }

        .mistakes-table td {
            padding: 8px 12px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .hit-badge {
            background: #d4edda;
            color: #155724;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 0.8rem;
        }

        .miss-badge {
            background: #fff3cd;
            color: #856404;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 0.8rem;
        }

        .wrong-badge {
            background: #f8d7da;
            color: #721c24;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 0.8rem;
        }

        .no-data {
            color: rgba(255, 255, 255, 0.5);
            font-style: italic;
        }

        /* Achievement Progress */
        .achievement-progress-bar-container {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 10px;
            height: 10px;
            overflow: hidden;
            margin-bottom: 10px;
        }

        .achievement-progress-bar {
            height: 100%;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
            border-radius: 10px;
            transition: width 0.6s ease;
        }

        .achievement-stats-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.95rem;
            color: rgba(255, 255, 255, 0.8);
            margin-bottom: 5px;
        }

        .achievement-remaining {
            color: rgba(255, 255, 255, 0.5);
            font-size: 0.85rem;
        }

        /* Achievement Category Groups */
        .achievement-category {
            margin-bottom: 12px;
        }

        .achievement-category-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 15px;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 10px;
            font-weight: 600;
            font-size: 0.95rem;
            color: #ffffff;
            cursor: pointer;
            list-style: none;
            border: 1px solid rgba(255, 255, 255, 0.12);
        }

        .achievement-category-header::-webkit-details-marker {
            display: none;
        }

        .achievement-category-header:hover {
            background: rgba(255, 255, 255, 0.12);
        }

        .locked-category {
            opacity: 0.45;
            cursor: default;
        }

        .category-progress {
            font-size: 0.8rem;
            color: rgba(255, 255, 255, 0.6);
            background: rgba(255, 255, 255, 0.1);
            padding: 2px 10px;
            border-radius: 12px;
        }

        /* Achievement Item Grid */
        .achievement-items {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 10px;
            padding: 12px 4px 4px;
        }

        .achievement-item {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            background: rgba(255, 255, 255, 0.07);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 10px;
            padding: 12px 14px;
            transition: background 0.2s;
        }

        .achievement-item:hover {
            background: rgba(255, 255, 255, 0.11);
        }

        .achievement-badge {
            font-size: 1.6rem;
            flex-shrink: 0;
            line-height: 1;
            margin-top: 2px;
        }

        .achievement-info {
            flex: 1;
            min-width: 0;
        }

        .achievement-name {
            font-weight: 700;
            font-size: 0.9rem;
            color: #ffffff;
            margin-bottom: 3px;
        }

        .achievement-desc {
            font-size: 0.8rem;
            color: rgba(255, 255, 255, 0.6);
            margin-bottom: 6px;
            line-height: 1.3;
        }

        .achievement-meta {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .achievement-xp {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: #ffffff;
            font-size: 0.75rem;
            font-weight: 700;
            padding: 2px 8px;
            border-radius: 10px;
        }

        .achievement-date {
            font-size: 0.75rem;
            color: rgba(255, 255, 255, 0.4);
        }

                /* Responsive Design */
        @media (max-width: 768px) {
            .nav-links {
                display: none;
                position: absolute;
                top: 100%;
                left: 0;
                right: 0;
                  background-color: var(--nav-links);
                flex-direction: column;
                padding: 1rem 2rem;
                box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            }

            .nav-links.active {
                display: flex;
            }

            .mobile-menu-btn {
                display: block;
            }

            .hero h1 {
                font-size: 2rem;
            }

            .hero p {
                font-size: 1rem;
            }

            .section-title {
                font-size: 2rem;
            }

            .games-grid {
                grid-template-columns: 1fr;
            }
        }

/* ===== Stats View Tab Toggle ===== */
.stats-view-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: fit-content;
}

.stats-tab {
    padding: 8px 24px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.stats-tab:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.stats-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-weight: 700;
}

/* ===== Graphs Viewer (single-chart carousel) ===== */

.graphs-panes-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    width: 100%;
}

.graphs-pane {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}


.graphs-date-range {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.graphs-date-range label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.graphs-date-range .date-input {
    width: 120px;
}

.graphs-viewer {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Nav bar: [←] [Title / Counter] [→] */
.graphs-nav-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.graphs-nav-arrow {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-radius: 10px;
    width: 48px;
    height: 48px;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.graphs-nav-arrow:hover {
    background: rgba(102, 126, 234, 0.35);
    transform: scale(1.08);
}

.graphs-nav-center {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.graphs-chart-title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.graphs-chart-counter {
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    margin-top: 3px;
}

/* Action bar: zoom / fullscreen / print */
.graphs-action-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    z-index: 10;
}

.action-btn-group {
    position: relative;
}

.zoom-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: auto;
    z-index: 100;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 14px;
    background: rgba(18, 12, 36, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    min-width: 260px;
}

/* Right-pane size panel opens right-aligned */
.zoom-panel-r {
    right: 0;
    left: auto;
}

.zoom-panel .quick-periods {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    margin-bottom: 0;
}

.zoom-group {
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 3px 8px;
}

.zoom-group-label {
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 4px;
    user-select: none;
}

/* Wrapper holds the slide container + edge indicators */
.chart-area-wrapper {
    position: relative;
    width: 100%;
}

/* Dropdown filters overlaid at the top-left of the chart */
.chart-filter-bar {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    pointer-events: none;
}

.chart-filter-bar .zoom-group {
    pointer-events: all;
    background: rgba(18, 12, 36, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 4px 10px;
}

/* Screen-edge hit indicators — shown when content is scrollable in that direction */
.edge-indicator {
    position: absolute;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 0;
}
.edge-indicator.visible { opacity: 1; }
.edge-left {
    left: 0; top: 0; bottom: 0; width: 16px;
    background: linear-gradient(to right, rgba(255,255,255,0.55) 0%, transparent 100%);
}
.edge-right {
    right: 0; top: 0; bottom: 0; width: 16px;
    background: linear-gradient(to left,  rgba(255,255,255,0.55) 0%, transparent 100%);
}
.edge-top {
    top: 0; left: 0; right: 0; height: 16px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.55) 0%, transparent 100%);
}
.edge-bottom {
    bottom: 0; left: 0; right: 0; height: 16px;
    background: linear-gradient(to top,   rgba(255,255,255,0.55) 0%, transparent 100%);
}

/* Chart slide container — scrollable in both axes, JS drag-pan */
.chart-slide-container {
    position: relative;
    width: 100%;
    overflow: auto;
    cursor: grab;
    /* Hide scrollbars in all browsers */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chart-slide-container::-webkit-scrollbar {
    display: none;
}

.chart-slide-container.dragging {
    cursor: grabbing;
    user-select: none;
}

.chart-slide {
    width: 100%;
    height: 460px; /* default — JS overrides with inline style on zoom */
}

.chart-slide canvas {
    display: block;
    width: 100%;
    height: 100%; /* fills the slide div; JS controls the slide size */
}

.chart-select {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    transition: background 0.15s;
}
.chart-select:hover  { background: rgba(255, 255, 255, 0.13); }
.chart-select option { background: #1a1030; color: #fff; }

/* Fullscreen overrides */
.graphs-viewer:fullscreen,
.graphs-viewer:-webkit-full-screen,
.graphs-viewer:-moz-full-screen {
    background: #110d1e;
    padding: 20px;
    border-radius: 0;
    overflow: hidden;
    height: 100vh;
    box-sizing: border-box;
    overscroll-behavior: none;
    touch-action: pan-y; /* allow vertical scroll, block horizontal browser-nav swipe */
}

/* Fullscreen: fits at scale 1.0; scrollbars appear only when user zooms in */
.graphs-viewer:fullscreen .chart-slide-container,
.graphs-viewer:-webkit-full-screen .chart-slide-container,
.graphs-viewer:-moz-full-screen .chart-slide-container {
    overflow: auto;
}


@media (max-width: 700px) {
    .graphs-chart-title { font-size: 13px; }
    .graphs-nav-arrow   { width: 40px; height: 40px; font-size: 24px; }
    .chart-slide        { height: 320px; }
    .graphs-panes-row   { flex-direction: column; }
}

/* ===== Print Styles ===== */
@media print {
    body * {
        visibility: hidden;
    }

    #printHeader,
    #printHeader *,
    .stats-grid,
    .stats-grid *,
    #panelGraphs,
    #panelGraphs * {
        visibility: visible;
    }

    .graphs-nav-bar,
    .graphs-action-bar,
    .stats-view-tabs {
        display: none !important;
    }

    .chart-slide-container {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .chart-slide {
        display: block !important;
        background: #f8f8f8 !important;
        border: 1px solid #ddd !important;
        border-radius: 8px;
        padding: 12px;
        page-break-inside: avoid;
    }

    .chart-slide canvas {
        height: 200px !important;
    }

    #printHeader {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        color: #1f2937;
        padding: 10px 20px;
        font-size: 0.85rem;
        border-bottom: 2px solid #667eea;
        display: flex;
        justify-content: space-between;
        z-index: 9999;
    }

    .stats-grid {
        position: fixed;
        top: 48px;
        left: 0;
        right: 0;
        padding: 12px 20px;
        display: grid !important;
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
    }

    .stats-grid .stat-card {
        background: #f3f4f6 !important;
        border: 1px solid #d1d5db !important;
        color: #1f2937 !important;
    }

    .stats-grid .stat-card .value,
    .stats-grid .stat-card .label {
        color: #1f2937 !important;
    }

    #panelGraphs {
        position: fixed;
        top: 160px;
        left: 0;
        right: 0;
        padding: 0 20px;
        display: block !important;
    }

}