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

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
            background-color: #f9fafb;
            color: #1e293b;
        }

        .container {
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            margin-top: 70px;
        }

        .header {
            background-color: #1e293b;
            color: white;
            padding: 20px 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 3px solid #27ae60;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 200;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }

        .header-content {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .logo {
            background-color: #27ae60;
            color: white;
            width: 45px;
            height: 45px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 20px;
        }

        h1 {
            margin: 0;
            font-size: 24px;
            font-weight: 600;
        }

        .user-info {
            font-size: 24px;
            font-weight: 600;
            color: #d1d5db;
        }

        .nav {
            background-color: white;
            padding: 15px 30px;
            display: flex;
            gap: 10px;
            border-bottom: 1px solid #e5e7eb;
            position: fixed;
            top: 70px;
            left: 0;
            right: 0;
            z-index: 100;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }

        .nav-btn {
            background-color: transparent;
            border: none;
            padding: 10px 20px;
            cursor: pointer;
            font-size: 15px;
            font-weight: 500;
            color: #6b7280;
            border-bottom: 2px solid transparent;
            transition: all 0.3s ease;
        }

        .nav-btn.active {
            color: #27ae60;
            border-bottom-color: #27ae60;
        }

        .content {
            flex: 1;
            padding: clamp(15px, 4vw, 30px);
            max-width: 1400px;
            margin: 0 auto;
            width: 100%;
            margin-top: 50px;
            zoom: 1.08;
        }

        .hidden {
            display: none;
        }

        h2 {
            font-size: clamp(18px, 5vw, 28px);
            font-weight: 600;
            margin-bottom: 20px;
            color: #1e293b;
        }

        h3 {
            font-size: clamp(14px, 4vw, 18px);
            font-weight: 600;
            margin-top: 30px;
            margin-bottom: 15px;
            color: #1e293b;
        }

        h4 {
            font-size: 13px;
            font-weight: 600;
            color: #1e293b;
            margin-bottom: 12px;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 15px;
            margin-bottom: 30px;
        }

        .stat-card {
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
            text-align: center;
            border-top: 3px solid #27ae60;
        }

        .stat-label {
            font-size: 12px;
            text-transform: uppercase;
            color: #9ca3af;
            font-weight: 600;
            margin-bottom: 10px;
        }

        .stat-value {
            font-size: 32px;
            font-weight: bold;
            color: #27ae60;
            margin-bottom: 5px;
        }

        .players-list {
            display: grid;
            gap: 15px;
        }

        .player-card {
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .player-card:hover {
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }

        .player-card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }

        .player-name {
            font-size: 15px;
            font-weight: 600;
            color: #1e293b;
        }

        .player-handicap {
            font-size: 12px;
            color: #9ca3af;
            margin-top: 4px;
        }

        .player-card-stats {
            display: flex;
            gap: 20px;
        }

        .player-stat {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .player-stat-label {
            font-size: 11px;
            color: #9ca3af;
            text-transform: uppercase;
        }

        .player-stat-value {
            font-size: 16px;
            font-weight: bold;
            color: #27ae60;
            margin-top: 4px;
        }

        .players-table {
            background-color: white;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
            overflow: hidden;
        }

        .table-header {
            display: grid;
            grid-template-columns: 2fr 0.8fr 1fr 1fr 1.2fr 0.8fr;
            background-color: #f3f4f6;
            padding: 15px 20px;
            font-weight: 600;
            font-size: 12px;
            text-transform: uppercase;
            color: #6b7280;
            border-bottom: 1px solid #e5e7eb;
        }

        .table-row {
            display: grid;
            grid-template-columns: 2fr 0.8fr 1fr 1fr 1.2fr 0.8fr;
            padding: 15px 20px;
            align-items: center;
            border-bottom: 1px solid #e5e7eb;
        }

        .table-row:nth-child(even) {
            background-color: #fafafa;
        }

        .table-col {
            text-align: center;
        }

        .table-col.col1 {
            text-align: left;
            padding-right: 10px;
        }

        .detail-btn {
            background-color: #3b82f6;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
            transition: background-color 0.2s;
        }

        .detail-btn:hover {
            background-color: #2563eb;
        }

        .back-btn {
            background-color: #f3f4f6;
            border: 1px solid #d1d5db;
            padding: 10px 16px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            color: #6b7280;
            transition: all 0.2s;
        }

        .back-btn:hover {
            background-color: #e5e7eb;
        }

        .player-detail-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 30px;
        }

        .player-detail-name {
            font-size: 28px;
            font-weight: 700;
            margin: 0 0 8px 0;
            color: #1e293b;
        }

        .player-detail-meta {
            font-size: 14px;
            color: #9ca3af;
        }

        .metric-card {
            background-color: white;
            padding: 25px;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
            text-align: center;
        }

        .metric-icon {
            font-size: 28px;
            margin-bottom: 10px;
        }

        .metric-label {
            font-size: 12px;
            text-transform: uppercase;
            color: #9ca3af;
            font-weight: 600;
            margin-bottom: 10px;
        }

        .metric-value {
            font-size: 28px;
            font-weight: bold;
            color: #27ae60;
            margin-bottom: 8px;
        }

        .benchmark {
            font-size: 11px;
            color: #9ca3af;
            line-height: 1.5;
            margin-top: 8px;
            font-weight: 500;
        }

        .charts-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: clamp(15px, 3vw, 25px);
            margin-bottom: 30px;
            width: 100%;
        }

        .chart-wrapper {
            background: white;
            padding: clamp(15px, 2vw, 25px);
            border-radius: 8px;
            border: 1px solid #e5e7eb;
            display: flex;
            flex-direction: column;
        }

        .chart-wrapper canvas {
            max-width: 100%;
            max-height: clamp(250px, 40vw, 350px);
            height: auto;
            margin-bottom: 15px;
        }

        .benchmark-table {
            margin-top: 15px;
            border-top: 1px solid #e5e7eb;
            padding-top: 15px;
        }

        .benchmark-table table {
            width: 100%;
            font-size: clamp(9px, 1.5vw, 12px);
            border-collapse: collapse;
        }

        .benchmark-table tr {
            border-bottom: 1px solid #f3f4f6;
        }

        .benchmark-table tr:last-child {
            border-bottom: none;
        }

        .bench-label {
            text-align: left;
            padding: 6px 0;
            color: #6b7280;
            font-weight: 500;
        }

        .bench-value {
            text-align: right;
            padding: 6px 0;
            color: #27ae60;
            font-weight: 600;
        }

        .charts-grid + p,
        .charts-grid ~ p {
            color: #9ca3af;
            font-size: 13px;
            margin: -10px 0 20px 0;
        }

        .chart-container {
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
            margin-bottom: 30px;
            overflow-x: auto;
        }

        .chart-container svg {
            min-width: 600px;
            width: 100%;
            height: 300px;
        }

        .chart-legend {
            display: flex;
            gap: 30px;
            margin-top: 15px;
            flex-wrap: wrap;
            font-size: 13px;
        }

        .chart-legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .chart-legend-dot {
            width: 12px;
            height: 12px;
            border-radius: 2px;
        }

        .rounds-list {
            display: grid;
            gap: 12px;
        }

        .round-card {
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .round-card:hover {
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }

        .round-card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .round-date {
            font-size: 14px;
            font-weight: 600;
            color: #1e293b;
        }

        .round-course {
            font-size: 12px;
            color: #9ca3af;
            margin-top: 4px;
        }

        .round-score {
            text-align: center;
        }

        .round-score-big {
            font-size: 28px;
            font-weight: bold;
            color: #27ae60;
        }

        .round-score-sub {
            font-size: 12px;
            color: #9ca3af;
            margin-top: 2px;
        }

        .round-action {
            margin-top: 12px;
            font-size: 13px;
            color: #3b82f6;
            font-weight: 600;
        }

        .round-summary-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 15px;
            margin-bottom: 30px;
        }

        .round-summary-card {
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
            text-align: center;
            border-left: 4px solid #27ae60;
        }

        .round-summary-label {
            font-size: 12px;
            text-transform: uppercase;
            color: #9ca3af;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .round-summary-value {
            font-size: 28px;
            font-weight: bold;
            color: #1e293b;
            margin-bottom: 4px;
        }

        .round-summary-subtext {
            font-size: 11px;
            color: #9ca3af;
        }

        .scorecard-container {
            background-color: white;
            border-radius: 8px;
            border: 1px solid #e5e7eb;
            overflow: hidden;
        }

        .scorecard {
            display: grid;
        }

        .score-hole {
            display: grid;
            grid-template-columns: 80px 80px 80px 80px;
            padding: 15px;
            align-items: center;
            border-bottom: 1px solid #e5e7eb;
            transition: background-color 0.2s;
            cursor: pointer;
            border-left: 4px solid #ef4444;
        }

        .score-hole.gir {
            border-left-color: #27ae60;
        }

        .score-hole:hover {
            background-color: #f9fafb;
        }

        .score-hole.expanded {
            background-color: #f0fdf4;
        }

        .score-hole-number {
            text-align: center;
            padding: 0 10px;
            border-right: 1px solid #e5e7eb;
        }

        .score-hole-number strong {
            font-size: 16px;
        }

        .score-hole-number small {
            font-size: 11px;
            color: #999;
            margin-top: 2px;
            display: block;
        }

        .score-hole-score,
        .score-hole-putts {
            text-align: center;
            padding: 0 10px;
            border-right: 1px solid #e5e7eb;
        }

        .score-hole-gir {
            text-align: center;
            padding: 0 10px;
        }

        .score-value {
            font-size: 18px;
            font-weight: bold;
            margin-top: 4px;
        }

        .hole-details {
            background-color: #f9fafb;
            padding: 20px;
            border-bottom: 1px solid #e5e7eb;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
        }

        .shot-by-shot {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .shot-row {
            display: flex;
            gap: 12px;
            padding: 10px;
            background-color: white;
            border-radius: 6px;
            border: 1px solid #e5e7eb;
        }

        .shot-number {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 30px;
            height: 30px;
            background-color: #f0fdf4;
            border-radius: 4px;
            font-weight: 600;
            color: #27ae60;
            font-size: 12px;
            flex-shrink: 0;
        }

        .shot-info {
            flex: 1;
            display: flex;
            gap: 15px;
            align-items: center;
        }

        .shot-club {
            min-width: 50px;
            font-weight: 600;
            color: #1e293b;
        }

        .shot-position {
            flex: 1;
            color: #6b7280;
            font-size: 13px;
        }

        .shot-distance {
            min-width: 80px;
            text-align: right;
            font-weight: 600;
            color: #3b82f6;
        }

        .hole-stats {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .hole-stat-grid {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 10px;
        }

        .hole-stat {
            background-color: white;
            padding: 12px;
            border-radius: 6px;
            border: 1px solid #e5e7eb;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .hole-stat-label {
            font-size: 11px;
            color: #9ca3af;
            text-transform: uppercase;
            margin-bottom: 6px;
        }

        .hole-stat-value {
            font-size: 16px;
            font-weight: 600;
            color: #1e293b;
        }

        .insights-box {
            display: grid;
            gap: 12px;
        }

        .insight {
            background-color: #f0fdf4;
            padding: 16px;
            border-radius: 8px;
            border: 1px solid #d1fae5;
            display: flex;
            gap: 15px;
            align-items: flex-start;
            font-size: 13px;
        }

        .insight-icon {
            flex-shrink: 0;
            font-size: 16px;
        }

        .stat-card:hover {
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }

        #player-filter-popup {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            z-index: 1000;
            display: flex;
            align-items: flex-start;
            justify-content: flex-start;
            padding: 140px 30px 0;
        }

        #player-filter-popup .popup-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.3);
            z-index: -1;
        }

        #player-filter-popup .popup-box {
            background: white;
            border-radius: 10px;
            box-shadow: 0 8px 30px rgba(0,0,0,0.2);
            padding: 20px;
            min-width: 260px;
            max-height: 70vh;
            overflow-y: auto;
            border: 1px solid #e5e7eb;
        }

        #player-filter-popup .popup-title {
            font-size: 14px;
            font-weight: 700;
            color: #1e293b;
            margin-bottom: 12px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        #player-filter-popup .popup-actions {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
        }

        #player-filter-popup .popup-actions button {
            flex: 1;
            padding: 6px;
            border: 1px solid #e5e7eb;
            border-radius: 6px;
            background: #f9fafb;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            color: #6b7280;
        }

        #player-filter-popup .popup-actions button:hover {
            background: #f3f4f6;
            color: #1e293b;
        }

        #player-filter-popup .player-checkbox-row {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 4px;
            border-bottom: 1px solid #f3f4f6;
            cursor: pointer;
        }

        #player-filter-popup .player-checkbox-row:last-child {
            border-bottom: none;
        }

        #player-filter-popup .player-checkbox-row:hover {
            background: #f9fafb;
            border-radius: 6px;
        }

        #player-filter-popup .player-checkbox-row input[type="checkbox"] {
            width: 16px;
            height: 16px;
            accent-color: #27ae60;
            cursor: pointer;
        }

        #player-filter-popup .player-checkbox-label {
            font-size: 14px;
            font-weight: 500;
            color: #1e293b;
            flex: 1;
        }

        #player-filter-popup .player-hcp-badge {
            font-size: 11px;
            color: #9ca3af;
            font-weight: 600;
        }

        /* ── Hamburger button (desktop: hidden) ── */
        .hamburger-btn {
            display: none;
            flex-direction: column;
            justify-content: center;
            gap: 5px;
            background: none;
            border: 1px solid rgba(255,255,255,0.2);
            border-radius: 6px;
            cursor: pointer;
            padding: 7px 9px;
            margin-left: 10px;
            flex-shrink: 0;
        }
        .hamburger-btn span {
            display: block;
            width: 20px;
            height: 2px;
            background: white;
            border-radius: 2px;
            transition: all 0.25s ease;
        }
        .hamburger-btn.open span:nth-child(1) {
            transform: translateY(7px) rotate(45deg);
        }
        .hamburger-btn.open span:nth-child(2) {
            opacity: 0;
        }
        .hamburger-btn.open span:nth-child(3) {
            transform: translateY(-7px) rotate(-45deg);
        }

        /* ── Mobile nav overlay ── */
        .nav-overlay {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 99;
            background: transparent;
        }
        .nav-overlay.open {
            display: block;
        }

        /* ── Par Stats grid ── */
        .par-stats-grid {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 0;
        }

        /* 4-column variant for ANS by Index (collapses to 1 column on mobile via the @media rule below) */
        .par-stats-grid--4 {
            grid-template-columns: 1fr 1fr 1fr 1fr;
        }

        @media (max-width: 768px) {
            .table-header, .table-row {
                grid-template-columns: 1.5fr 0.8fr 1fr 0.8fr;
            }

            .hole-details {
                grid-template-columns: 1fr;
            }

            .charts-grid {
                grid-template-columns: 1fr;
            }

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

            /* Hole scorecard: fluid columns instead of fixed 80px */
            .score-hole {
                grid-template-columns: repeat(4, 1fr);
                padding: 10px 8px;
            }

            .score-value {
                font-size: 15px;
            }

            .score-hole-number strong {
                font-size: 14px;
            }

            /* PAR STATS: stack vertically on mobile */
            .par-stats-grid {
                grid-template-columns: 1fr;
            }

            .par-stats-grid > div {
                border-right: none !important;
                border-bottom: 1px solid #f3f4f6;
            }

            .par-stats-grid > div:last-child {
                border-bottom: none;
            }

            /* Header: stay horizontal on mobile */
            .header {
                flex-direction: row;
                gap: 0;
                align-items: center;
                padding: 12px 16px;
            }

            .header h1 {
                font-size: 17px;
            }

            .logo {
                width: 34px;
                height: 34px;
                font-size: 15px;
            }

            .user-info {
                font-size: 13px;
                margin-left: auto;
                margin-right: 0;
            }

            .hamburger-btn {
                display: flex;
            }

            /* Nav: hidden by default, drops down as overlay */
            .nav {
                display: none;
                flex-direction: column;
                top: 56px;
                padding: 6px 0;
                gap: 0;
                box-shadow: 0 6px 20px rgba(0,0,0,0.15);
                z-index: 100;
            }

            .nav.open {
                display: flex;
            }

            .nav-btn {
                padding: 14px 22px;
                text-align: left;
                border-bottom: none;
                border-left: 3px solid transparent;
                font-size: 15px;
                width: 100%;
                border-radius: 0;
            }

            .nav-btn.active {
                border-left: 3px solid #27ae60;
                border-bottom: none;
                background: #f0fdf4;
                color: #27ae60;
            }

            /* Content: only header height margin (no nav bar) */
            .container {
                margin-top: 56px;
            }

            .content {
                margin-top: 10px;
            }
        }

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

        /* Insights view */
        .insights-filter-grid {
            grid-template-columns: 2fr 1fr 1fr 120px 160px auto;
        }

        .leak-holes-grid {
            grid-template-columns: repeat(3, 1fr);
        }

        @media (max-width: 900px) {
            .insights-filter-grid {
                grid-template-columns: 1fr 1fr 1fr !important;
            }
        }

        @media (max-width: 600px) {
            .insights-filter-grid {
                grid-template-columns: 1fr !important;
            }

            .leak-holes-grid {
                grid-template-columns: repeat(2, 1fr) !important;
            }
        }

/* ---- Admin nav groups (dropdowns) ---- */
.nav-group { position: relative; display: inline-block; }
.nav-group-btn { cursor: pointer; }
.nav-dropdown {
    position: absolute; top: 100%; left: 0; z-index: 300;
    display: none; flex-direction: column; min-width: 172px;
    background: #ffffff; border: 1px solid #e5e7eb; border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; margin-top: 6px;
}
.nav-dropdown.open { display: flex; }
.nav-dropdown .nav-btn { display: block; width: 100%; text-align: left; padding: 8px 12px; border-bottom: none; border-radius: 6px; }
.nav-dropdown .nav-btn:hover { background: #f3f4f6; }
