/* ================================
   1. CORE VARIABLES & GLOBAL
================================ */
:root {
    --bg-main: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --primary-green: #10b981;
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
                   0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.modal.hidden {
    display: none;
}

/* ================================
   2. SIDEBAR & NAV
================================ */
/* SIDEBAR BASE */
.sidebar {
    width: 240px;
    background: var(--white);
    border-right: 1px solid var(--border-color);
    transition: width 0.3s ease;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: 72px;
}

/* HIDE TEXT WHEN COLLAPSED */
.sidebar.collapsed .nav-item span {
    display: none;
}

/* CENTER ICONS WHEN COLLAPSED */
.sidebar.collapsed .nav-item {
    justify-content: center;
}

/* HEADER + TOGGLE BUTTON */
.sidebar-header {
    position: relative;
    z-index: 1000;
}

#toggle-sidebar {
    position: relative;
    z-index: 2000;
    pointer-events: auto;
}

#sidebar-arrow {
    pointer-events: none;
}

/* NAV ITEMS — CLEAN, CONSOLIDATED */
.sidebar a.nav-item {
    display: flex;
    width: 100%;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.2s ease;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px; /* ← THIS is the missing piece */
}

/* HOVER (EXPANDED) */
.sidebar a.nav-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* HOVER (COLLAPSED) */
.sidebar.collapsed a.nav-item:hover {
    background: rgba(0, 0, 0, 0.12);
}

/* Tooltip container */
.sidebar.collapsed a.nav-item {
    position: relative;
}

/* Tooltip text */
.sidebar.collapsed a.nav-item:hover::after {
    content: attr(data-label);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    margin-left: 8px;
    font-size: 0.85rem;
    z-index: 9999;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* ================================
   3. MAIN LAYOUT & CARDS
================================ */
.main-content {
    flex: 1;
    padding: 40px;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 24px;
    color: var(--text-dark);
}

.main-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.list-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.card-header h3,
.title-group h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
	margin: 0;
}

.card-header i,
.title-group i {
    color: #10b981;
}

/* ================================
   4. WEEKLY SCORES HEADER & NAV
================================ */
.card-header,
.weekly-scores-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    margin: 0 0 8px 0;
    min-height: 36px; /* normalize header height */
}

.title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-group i {
    color: var(--text-muted);
}

.title-group h3 {
    margin: 0;
    font-size: 1.1rem;
}

.card-header {
    position: relative;
    z-index: 50;
    background: var(--white);
}

.title-group {
    position: relative;
    z-index: 100;
}

.date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 2px 6px;
	border-radius: 8px;
	margin: 0;
	line-height: 1;
}

.date-nav button {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-weight: bold;
}

.date-nav button:disabled {
    background: #f8fafc;
    color: #cbd5e1;
    border-color: #f1f5f9;
    cursor: not-allowed;
    opacity: 0.6;
}

.date-nav button:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: var(--primary-green);
}

#current-date-display {
    background: transparent;
    border: none;
    width: 90px;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.ws-icon i {
    font-size: 14px;
    cursor: pointer;
    color: #444;
}

/* ================================
   5. STANDINGS (CARD ROW STYLE)
================================ */
/* --- STANDINGS LIST (compact, striped) --- */
#standings-list {
    display: flex;
    flex-direction: column;
}

.standing-row {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

/* Rank number */
.standing-rank {
    width: 28px;
    text-align: center;
    font-weight: 700;
    color: var(--primary-green); /* green rank numbers */
}

/* Team name */
.standing-team {
    flex: 1;
    font-weight: 600;
    color: var(--text-dark);
}

/* Record */
.standing-record {
    width: 50px;
    text-align: right;
    font-weight: 700;
    color: var(--primary-green);
}

/* ================================
   6. WEEKLY SCORES (CARD ROW STYLE)
================================ */
#weekly-scores-entry-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    font-size: 11px;
}

.weekly-score-row {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.weekly-team {
    flex: 1;
    font-weight: 600;
    color: var(--text-dark);
}

.weekly-points {
    width: 40px;
    text-align: right;
    font-weight: 700;
    color: var(--primary-green); /* match standings */
}

/* ================================
   7. ACTION BUTTONS & DROPDOWNS
================================ */
.action-btn,
.back-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    font-weight: 600;
}

.action-btn.primary {
    background: var(--primary-green);
    color: white;
    border: none;
}

.action-btn.primary:hover {
    background: #059669;
}

.season-dropdown {
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.season-dropdown:focus {
    border-color: var(--primary-green);
}

/* ================================
   8. FULL SCHEDULE TABLE (MODERN)
================================ */
#full-schedule-content .schedule-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#full-schedule-content .schedule-grid thead th {
    background-color: #00a600 !important;
    color: white !important;
    padding: 10px;
    font-weight: 600;
    text-align: center;
    border-radius: 4px;
    border: 1px solid #008f00;
}

#full-schedule-content .schedule-grid td {
    border: 1px solid #cbd5e1;
    padding: 12px 8px;
    vertical-align: middle;
    text-align: center;
    font-size: 0.85rem;
}

/* Past events logic */
#full-schedule-content tr.past-event {
    background: #f1f5f9;
    opacity: 0.7;
}

#full-schedule-content tr.past-event .date-cell {
    color: #ef4444;
    font-weight: bold;
}

.schedule-grid td.date-col {
    color: #d00000 !important; /* strong red */
    font-weight: 600;
    text-align: center !important;
}

.past-event td {
    color: #94a3b8 !important;
}

/* Highlight current week */
.current-week {
    background-color: #f0fdf4 !important;
    border-left: 5px solid #10b981;
}

.current-week td {
    font-weight: 500;
}

/* Holiday / No Play Row */
.holiday-row {
    background: #fefce8;
    color: #854d0e;
    font-weight: 600;
    text-align: left !important;
    padding-left: 20px !important;
}

.past-week > td:first-child,
.current-week > td:first-child,
.future-week > td:first-child {
    border-left: 4px solid transparent;
}

.past-week > td:first-child {
    border-left-color: #94a3b8; /* slate-400 */
}

.current-week > td:first-child {
    border-left-color: #facc15; /* amber-400 */
}

.future-week > td:first-child {
    border-left-color: #cbd5e1; /* slate-300 */
}

/* ================================
   10. MATCH / EVENT / COMMENT ROWS
================================ */
.comment-row td {
    padding: 6px 10px;
    background: #eef5ff;
    border-left: 3px solid #4a90e2;
}

.comment-box {
    font-style: italic;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.match-col {
    text-align: center;
    padding: 6px;
    min-width: 90px;
    position: relative;
    overflow: visible !important;
}

.event-col {
    vertical-align: middle;
    position: relative;
    overflow: visible !important;
    text-align: center !important;
}

.event-col-header {
    width: 70px;
}

.event-number {
    font-weight: 600;
    margin-bottom: 2px;
}

.event-controls,
.match-controls {
    display: flex;
    justify-content: center;
    gap: 4px;
    position: relative;
    z-index: 2;
    pointer-events: auto;
}

.match-box {
    background: #ffffff;
    border: 1px solid #ddd;
    padding: 6px 8px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.15s ease;
}

.match-box:hover {
    box-shadow: 0 0 6px rgba(0,0,0,0.15);
}

.match-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
}

.match-inner.vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

.match-text {
    display: block;
    text-align: center;
    font-weight: 500;
    color: var(--text-dark);
}

.match-col,
.match-inner,
.match-text {
    overflow: visible !important;
}

.match-controls.under {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

.add-btn {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px dashed #aaa;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
}

.tiny-btn {
    margin-left: 4px;
    padding: 2px 5px;
    font-size: 12px;
    border: none;
    background: #eee;
    cursor: pointer;
    border-radius: 4px;
}

.tiny-btn.danger {
    background: #ffdddd;
    color: #b91c1c;
}

.comment-cell {
    padding: 10px;
}

.comment-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.comment-controls {
    display: flex;
    gap: 4px;
}

/* Week insert controls */
.week-insert-controls {
    margin-top: 4px;
    display: flex;
    gap: 6px;
}

.insert-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 2px 4px;
    line-height: 1;
}

.arrow-up,
.arrow-down {
    font-size: 0.75em;
    position: relative;
}

.arrow-up {
    top: -1px;
}

.arrow-down {
    top: 1px;
}

/* Active week highlight (legacy) */
.active-week {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
    border: 2px solid #2E7D32;
}

/* ================================
   11. ADMIN PAGE
================================ */
#menu-admin,
#page-admin {
    display: none;
}

#page-admin h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1rem;
    color: var(--text-dark);
}

#page-admin p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.admin-input {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
}

.admin-form-group {
    margin-bottom: 1.5rem;
}

.admin-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.025em;
}

/* Hide week header spacing for non-admins */
body:not(.is-admin) .week-header {
    height: 0;
    padding: 0;
    margin: 0;
    line-height: 0;
    overflow: hidden;
}

/* Hover effect for key table */
.key-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.key-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

.key-num {
    font-weight: 800;
    color: var(--primary-green);
    width: 40px;
}

.key-table tr:hover {
    background-color: #f8fafc;
}

/* ================================
   12. MODALS (NEWEST STYLE ONLY)
================================ */
/* Fullscreen overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.55);
    display: none; /* hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
}

/* Centered modal box */
.modal-content,
.modal-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 380px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.modal-content label {
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #0f172a;
    background: #f8fafc;
    transition: border-color 0.15s ease;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: #10b981;
    background: #ffffff;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-actions button {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: background 0.15s ease, transform 0.1s ease;
}

/* Cancel */
.modal-actions button:nth-child(1) {
    background: #e2e8f0;
    color: #334155;
}

.modal-actions button:nth-child(1):hover {
    background: #cbd5e1;
}

/* Save */
.modal-actions button:nth-child(2) {
    background: #10b981;
    color: white;
    font-weight: 600;
}

.modal-actions button:nth-child(2):hover {
    background: #059669;
    transform: translateY(-1px);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Modal animation */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FORCE CELLS TO INHERIT ROW BACKGROUND */
.schedule-grid td {
    background-color: inherit !important;
}

/* ZEBRA STRIPING — ONLY MATCH ROWS, ONLY FUTURE WEEKS */
.schedule-grid tbody tr.match-row.future-week:nth-of-type(odd) {
    background-color: #ffffff !important;
}

.schedule-grid tbody tr.match-row.future-week:nth-of-type(even) {
    background-color: #f8fafc !important;
}

/* WEEK SHADING */
/* Zebra striping applied ONLY to match rows */
.stripe-even {
    background-color: #ffffff !important;
}

.stripe-odd {
    background-color: #f8fafc !important;
}

/* Week shading overrides striping */
.past-week {
    background-color: #e2e8f0 !important; /* slate-200 */
}

.current-week {
    background-color: #fff3cd !important;
}

.future-week {
    background-color: transparent !important;
}

.schedule-grid tr.match-row.stripe-even td,
.schedule-grid tr.match-row.stripe-even {
    background-color: #ffffff !important;
}

.schedule-grid tr.match-row.stripe-odd td,
.schedule-grid tr.match-row.stripe-odd {
    background-color: #f1f5f9 !important; /* slate-100 */
}

#full-schedule-content .schedule-grid tr.match-row.stripe-even,
#full-schedule-content .schedule-grid tr.match-row.stripe-even td {
    background-color: #ffffff !important;
}

#full-schedule-content .schedule-grid tr.match-row.stripe-odd,
#full-schedule-content .schedule-grid tr.match-row.stripe-odd td {
    background-color: #f8fafc !important;
}

.schedule-grid thead th {
    background-color: #00a600 !important;
    color: white !important;
    padding: 10px;
    font-weight: 600;
    text-align: center;
    border-radius: 4px;
    border: 1px solid #008f00;
}

.players-table table {
    width: 100%;
    border-collapse: collapse;
}

.players-table th,
.players-table td {
    padding: 6px 8px;
}

.players-table th.sorted-asc::after {
    content: " ▲";
}

.players-table th.sorted-desc::after {
    content: " ▼";
}

/* Left‑justify these columns */
.players-table th:nth-child(1),
.players-table td:nth-child(1),   /* Name */
.players-table th:nth-child(2),
.players-table td:nth-child(2),   /* Status */
.players-table th:nth-child(3),
.players-table td:nth-child(3),   /* Email */
.players-table th:nth-child(4),
.players-table td:nth-child(4) {  /* Phone */
    text-align: left;
}

/* Center these columns */
.players-table th:nth-child(5),
.players-table td:nth-child(5),   /* Handicap */
.players-table th:nth-child(6),
.players-table td:nth-child(6) {  /* Team */
    text-align: center;
}

/* Actions column stays right-aligned or centered depending on your preference */
.players-table th:nth-child(7),
.players-table td:nth-child(7) {
    text-align: center;
}

.players-table tr:hover {
    background: #f7f7f7;
}

.players-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.small-btn {
    padding: 4px 8px;
    margin-right: 4px;
    font-size: 12px;
}

.small-btn.danger {
    background: #c0392b;
    color: white;
}

/* The dark overlay */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.55);
    display: none; /* hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
}

/* The white modal box */
.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 350px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px 12px;
    background: #f8fafb;
    align-items: flex-start;        /* force left alignment of children */
}

.radio-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: auto;                    /* don't stretch full width */
    margin-right: auto;             /* push to left side */
}

.radio-row input[type="radio"] {
    margin: 0;
}

.radio-row label {
    margin: 0;
    line-height: 1.2;
    cursor: pointer;
}

/* Weekly Event prep */
#prepare-weekly-event {
    margin-top: 10px;
}

#pwe-week-header h3 {
    margin: 0 0 8px 0;
}

.pwe-match-block {
    border-top: 1px solid #ccc;
    padding: 6px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pwe-team-block {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.pwe-team-block h5 {
    margin: 0 8px 0 0;
    font-size: 0.95rem;
}

.pwe-team-block select {
    min-width: 180px;
    font-size: 0.9rem;
    padding: 2px 4px;
}

#weekly-scores-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.red {
    color: #c00;
    font-weight: 600;
}

.score-btn,
.card-btn {
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
}

.delete-score-btn:hover { color: #e74c3c !important; }

/* ================================
   SCORE ENTRY — CONSOLIDATED CSS
================================ */

/* Wrapper: allows horizontal scrolling */
.scorecard-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
}

/* Table core */
#scorecard-table {
    width: 100%;
    border-collapse: collapse; /* Essential for clean lines */
    margin-top: 10px;
}

#scorecard-table th, 
#scorecard-table td {
    border: 1px solid #cbd5e1; /* Light slate border */
    padding: 6px 4px;
    text-align: center;
    width: 30px; /* Fixed width for score boxes */
}

/* Make the total columns stand out with a different background */
.total-cell {
    background-color: #f1f5f9 !important;
    font-weight: bold;
    width: 40px !important; 
}

/* Add a thicker line after the 9th and 18th hole to separate totals */
#scorecard-table td:nth-child(11), 
#scorecard-table th:nth-child(11),
#scorecard-table td:nth-child(21),
#scorecard-table th:nth-child(21) {
    border-right: 2px solid #64748b;
}

/* OUT column (hole 9 total) */
#extra-round-table td:nth-child(11) {
    background: #e8f2ff !important;
}

/* IN column (hole 18 total) */
#extra-round-table td:nth-child(21) {
    background: #e8f2ff !important;
}

/* TOT column */
#extra-round-table td:nth-child(22) {
    background: #d9e9ff !important;
    font-weight: 600;
}

/* Label column (Hole, Par, HCP, Score) */
.label-cell {
    font-weight: bold;
    background: #e9e9e9;
    text-align: left;
    min-width: 60px;
    max-width: 60px;
}

/* Thick borders at 9 and 18 */
.nine-break {
    border-right: 3px solid #000 !important;
}

/* Alternating shading for readability */
#scorecard-table td:nth-child(odd):not(.label-cell),
#scorecard-table th:nth-child(odd):not(.label-cell) {
    background: #f7f7f7;
}

/* Score input fields */
.score-input {
    width: 2.2em;
    padding: 1px;
    text-align: center;
    -moz-appearance: textfield;
}

.score-input::-webkit-inner-spin-button,
.score-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* GLOBAL: Remove spinner arrows from ALL number inputs */
/* Prevent arrow keys from incrementing/decrementing number inputs */
input[type=number] {
    -moz-appearance: textfield;
}

input[type=number]:focus {
    outline: none;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Disable keyboard arrow increment/decrement */
input[type=number] {
    ime-mode: disabled;
}

input[type=number] {
    caret-color: auto;
}

input[type=number] {
    /* Prevent arrow keys from changing value */
    -webkit-appearance: none;
}

/* Color coding for score results */
.score-birdie { background: #d0f5d0 !important; }
.score-par    { background: #e9f0ff !important; }
.score-bogey  { background: #ffe0e0 !important; }

/* Mobile adjustments */
@media (max-width: 768px) {
    #scorecard-table { font-size: 0.7rem; }
    .score-input { width: 2em; }
}

/* DASHBOARD GRID (Weekly Scores List) */
.score-row {
    display: grid;
    grid-template-columns: 26px 26px 26px 150px repeat(9, 28px) 35px repeat(9, 28px) 35px 35px 35px 35px 50px;
    align-items: start;
    background: white;
    height: 25px;
    padding: 0;
}

.score-row.header {
    background: #d1f2d1;   /* light green */
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 10;
}

.score-row > div {
    border: 1px solid #d0d7de;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    line-height: 22px;
    background: #fff;
}

/* OUT column */
.score-row > div:nth-child(13) {
    background: #e8f2ff;   /* light blue */
}

/* IN column */
.score-row > div:nth-child(23) {
    background: #e8f2ff;
}

/* TOT column */
.score-row > div:nth-child(24) {
    background: #d9e9ff;   /* slightly stronger blue */
    font-weight: 600;
}

/* Zebra striping */
.score-row:nth-child(even) > div {
    background: #f3fdf3;   /* very light green */
}

.score-row:nth-child(odd) > div {
    background: #ffffff;
}

.ws-name {
    justify-content: flex-start !important;
    text-align: left;
    padding-left: 6px;
}

.header-total {
    background: #e2e8f0;
    font-weight: 800;
}

/* Reapply OUT/IN/TOT shading after zebra */
.score-row > div:nth-child(13),
.score-row > div:nth-child(23) {
    background: #e8f2ff !important;
}

.score-row > div:nth-child(24) {
    background: #d9e9ff !important;
}

/* Header row cells: green background */
.score-row.header > div {
    background: #c8eec8 !important;  /* light green */
    font-weight: 700;
}

.scorecard-header > * {
    background: #c8eec8 !important;
    font-weight: 700;
}
/* OUT column */
#scorecard-body td:nth-child(11) {
    background: #e8f2ff !important;
}

/* IN column */
#scorecard-body td:nth-child(21) {
    background: #e8f2ff !important;
}

/* TOTAL column */
#scorecard-body td:nth-child(22) {
    background: #d9e9ff !important;
    font-weight: 600;
}

/* If header is just the first row in the list */
#weekly-scores-entry-list .score-row:first-child > div {
    background: #c8eec8 !important;
    font-weight: 700;
}

#page-score-entry {
    display: none;
}

.ws-birdie {
    color: green;
    font-weight: bold;
}

.ws-par {
    color: black;
}

.ws-bogey {
    color: red;
    font-weight: bold;
}

table.sc tbody tr:not(.pts-row) td {
    font-weight: 500 !important;
}

.ws-col.ws-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/*---------------------------------------------------------------*/
/* ── Skins setup ── */

/* Replace the grid with a table-based layout so name col sizes to content */
#skins-player-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 2rem;
}

.skins-player-row {
    border-bottom: 0.5px solid #f0f0f0;
}

.skins-player-label {
    display: flex;
    align-items: center;
    padding: 3px 4px;
    cursor: pointer;
    gap: 10px;
    width: fit-content;        /* ← key: shrinks to name + checkboxes, not full column width */
}

.skins-player-label:hover { background: #f5f7fa; border-radius: 3px; }

.skins-col-name {
    font-size: 12px;
    color: #1a1a2e;
    white-space: nowrap;       /* ← don't wrap, size to text */
    flex-shrink: 0;
}

.skins-col-checks {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.skins-col-checks input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    cursor: pointer;
    accent-color: #1a5276;
}

/* Header row matches exactly */
.skins-list-header-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 2rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0;
}

.skins-list-header-cell {
    display: flex;
    align-items: center;
    padding: 2px 4px 4px;
    gap: 10px;
    width: fit-content;        /* ← mirrors player row */
}

.skins-col-name-header {
    font-size: 10px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.skins-col-checks-header {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.skins-col-checks-header span {
    width: 15px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: #888;
}

/* Blank line after buy-in */
.skins-buyin-row {
    font-size: 13px;
    margin-bottom: 1.25rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid #f0f0f0;
}

.skins-tables-wrap {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

table.skins-setup-table {
    border-collapse: collapse;
    table-layout: auto;         /* name col sizes to longest name */
}

table.skins-setup-table thead th {
    font-size: 10px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 2px 6px 5px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

th.skins-name-cell,
td.skins-name-cell {
    text-align: left;
    padding-right: 14px;        /* gap between name and first checkbox */
}

th.skins-chk-cell,
td.skins-chk-cell {
    width: 32px;                /* fixed — same for header and data */
    text-align: center;
    padding: 0;
}

td.skins-name-cell {
    font-size: 12px;
    color: #1a1a2e;
    white-space: nowrap;
    padding-top: 3px;
    padding-bottom: 3px;
}

table.skins-setup-table tbody tr:hover td {
    background: #f5f7fa;
    cursor: pointer;
}

table.skins-setup-table tbody tr {
    border-bottom: 0.5px solid #f0f0f0;
}

table.skins-setup-table input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    cursor: pointer;
    accent-color: #1a5276;
    display: block;
    margin-inline: auto;
}

.skins-save-row { margin-top: 1rem; }

.skins-table-wrap { overflow-x: auto; margin-bottom: 1rem; }

table.skins-grid {
    border-collapse: collapse;
    font-size: 12px;
    white-space: nowrap;
}

table.skins-grid th,
table.skins-grid td {
    border: 0.5px solid #ddd;
    text-align: center;
    padding: 3px 5px;
}

table.skins-grid th {
    background: #f7f7f7;
    font-weight: 500;
    color: #888;
    font-size: 11px;
}

th.sg-name, td.sg-name {
    text-align: left !important;
    padding-left: 8px;
    min-width: 160px;
    font-size: 12px;
}

th.sg-hole, td.sg-hole { width: 26px; }

th.sg-skins, td.sg-skins {
    width: 28px;
    background: #f7f7f7;
    font-weight: 600;
}

td.sg-skins.has-skin { color: #0F6E56; }

tr.sg-par-row td { background: #f0f0f0; color: #888; font-size: 11px; }
tr.sg-hcp-row td { background: #f7f7f7; color: #aaa; font-size: 11px; }

/* Score colouring */
td.skin-win  { background: #d1fae5 !important; font-weight: 700; }
td.eagle     { color: #0a4f3c; font-weight: 700; }
td.birdie    { color: #0F6E56; font-weight: 500; }
td.bogey     { color: #993C1D; }
td.double    { color: #7b1010; font-weight: 500; }

.stroke-dot  { font-size: 7px; vertical-align: super; color: #111; margin-left: 1px; }
.hcp-badge   { font-size: 10px; color: #888; font-weight: 400; }

.skins-pin-section {
    margin: 1rem 0 .5rem;
    padding: .75rem;
    background: #f7f9ff;
    border: 0.5px solid #d0d8f0;
    border-radius: 6px;
    max-width: 420px;
}
.skins-pin-title    { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.skins-pin-subtitle { font-size: 11px; color: #888; margin-bottom: .6rem; }
.skins-pin-grid     { display: flex; flex-direction: column; gap: 6px; }
.skins-pin-row      { display: flex; align-items: center; gap: 10px; }
.skins-pin-label    { font-size: 12px; min-width: 110px; }
.skins-pin-select   { font-size: 12px; padding: 2px 4px; border: 1px solid #ccc; border-radius: 4px; min-width: 180px; }
.skins-payout-detail { color: #444; }
.skins-pin-summary  { margin-top: .5rem; }

/*---------------------------------------------------------------*/


.pwe-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.pwe-course-select label {
    margin-right: 6px;
    font-weight: 600;
}

.pwe-course-select select {
    padding: 4px 6px;
    font-size: 14px;
}

.er-existing-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.er-delete-btn {
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
    font-size: 12px;
}
.er-delete-btn:hover { background: #e74c3c; }

.rg-overlay { position:fixed;inset:0;background:rgba(0,0,0,0.5);display:flex;align-items:center;justify-content:center;z-index:9999 }
.rg-modal { background:#fff;border-radius:10px;width:500px;max-height:80vh;overflow-y:auto;padding:1.25rem 1.5rem }
.rg-header { display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem }
.rg-title { font-size:15px;font-weight:600 }
.rg-close { background:none;border:1px solid #ccc;border-radius:5px;padding:3px 10px;cursor:pointer }
.rg-subtitle { font-size:11px;color:#888;margin-bottom:1rem }
.rg-item { display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid #e0e0e0;border-radius:6px;margin-bottom:6px;background:#fff;cursor:grab;user-select:none }
.rg-item.rg-dragging { opacity:0.4 }
.rg-handle { color:#aaa;font-size:16px;cursor:grab }
.rg-tee { font-size:12px;color:#666;min-width:60px }
.rg-name { font-size:13px;font-weight:500 }
.rg-footer { margin-top:1rem;text-align:right }
.rg-save { background:#1a3a5c;color:#fff;border:none;border-radius:6px;padding:6px 18px;cursor:pointer;font-size:13px }
.rg-save:hover { background:#2c5282 }

.session-standings-block { margin-top: 1.5rem; }
.session-standings-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .4rem; }
.session-standings-title { font-size: 14px; font-weight: 600; color: #1a3a5c; }
.session-event-range { font-size: 11px; color: #888; }
.session-admin-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.session-admin-title { font-size: 13px; font-weight: 600; margin-bottom: .5rem; text-transform: uppercase; letter-spacing: .04em; color: #888; }

.home-stat-block { padding: 6px 0; border-bottom: 0.5px solid #f0f0f0; }
.home-stat-label { font-size: 12px; background: #e8e8e8; padding: 2px 8px; border-radius: 3px; display: inline-block; margin-bottom: 2px; }
.home-stat-players { font-size: 13px; color: #2e7d32; font-weight: 500; padding-left: 4px; }
.home-doc-row { padding: 5px 0; border-bottom: 0.5px solid #f0f0f0; }
.home-doc-link { font-size: 13px; color: #1a5276; text-decoration: none; }
.home-doc-link:hover { text-decoration: underline; }

.home-header {
    text-align: center;
    padding: 1.5rem 0 1rem;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
}
.home-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a3a5c;
    margin: 0;
}

.home-logo {
    width: 100%;
    text-align: center;
    margin: 0 0 0.5rem 0;
    padding: 0;
}

.home-logo img {
    max-width: 350px;
    width: 60%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.home-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 0.5rem 0 1rem;
}

.home-news-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    width: 100%;
}

.home-news-content p  { margin: 0 0 .6rem; font-size: 14px; line-height: 1.6; }
.home-news-content ul { margin: 0 0 .6rem; padding-left: 1.5rem; font-size: 14px; }
.home-news-content li { margin-bottom: .3rem; }
.home-stat-block { padding: 6px 0; border-bottom: 0.5px solid #f0f0f0; }
.home-stat-label {
    font-size: 11px;
    background: #e8e8e8;
    padding: 2px 8px;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 2px;
    color: #444;
}
.home-stat-players { font-size: 13px; color: #2e7d32; font-weight: 500; padding-left: 4px; }
.home-doc-row { padding: 5px 0; border-bottom: 0.5px solid #f0f0f0; }
.home-doc-link { font-size: 13px; color: #1a5276; text-decoration: none; }
.home-doc-link:hover { text-decoration: underline; }
.home-no-docs, .home-no-news { color: #aaa; font-size: 13px; }

/* Rich text editor */
.rte-toolbar {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}
.rte-toolbar button {
    width: 30px; height: 28px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}
.rte-toolbar button:hover { background: #f0f0f0; }
.rte-editor {
    min-height: 200px;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px;
    font-size: 14px;
    line-height: 1.6;
    outline: none;
}
.rte-editor:focus { border-color: #1a3a5c; }

.pns-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}
.pns-modal {
    background: #fff;
    border-radius: 10px;
    width: 95vw;
    max-height: 90vh;
    overflow: auto;
    padding: 1.25rem 1.5rem;
}
.pns-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: .75rem;
}
.pns-title { font-size: 16px; font-weight: 700; }
.pns-subtitle { font-size: 13px; color: #444; }
.pns-course { font-size: 13px; color: #666; margin-top: 4px; }
.pns-close {
    background: none; border: 1px solid #ccc; border-radius: 5px;
    padding: 4px 10px; cursor: pointer;
}
.pns-table-wrap { overflow-x: auto; }
.pns-table {
    border-collapse: collapse;
    font-size: 12px;
    width: 100%;
}
.pns-table th, .pns-table td {
    border: 1px solid #ddd;
    padding: 3px 6px;
    text-align: center;
}
.pns-table th {
    background: #f5f5f5;
    font-weight: 600;
}
.pns-name { text-align: left; white-space: nowrap; }
.pns-leader td { background: #d4f5d4; }
.pns-even td { background: #fafafa; }
.pns-net { font-weight: 700; }
.pns-eagle  { color: #d4a017; font-weight: 700; }
.pns-birdie { color: #2e7d32; font-weight: 700; }
.pns-bogey  { color: #c0392b; }
.pns-double { color: #922b21; font-weight: 700; }
.pns-summary-row td {
    background: #f0f0f0;
    font-weight: 600;
}
.pns-summary-label { text-align: right; }

