/* ============================================
   LU VALLE FRIDAY GAME
   iOS-Inspired Design + Navy/Gold Theme
   Inspired by SanDiegoElites.com
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    /* Navy Blues */
    --navy-900: #0B1120;
    --navy-800: #0F1B2D;
    --navy-700: #152238;
    --navy-600: #1B2D4A;
    --navy-500: #243B5C;
    --navy-400: #3A5580;
    --navy-300: #5A7AAD;
    --navy-200: #8BA3C9;
    --navy-100: #C5D3E8;
    --navy-50: #EDF1F7;

    /* Gold Accents */
    --gold-600: #9A7D2E;
    --gold-500: #C8A951;
    --gold-400: #D4BA6A;
    --gold-300: #E0CC8A;
    --gold-200: #EDE0B4;
    --gold-100: #F8F3E0;
    --gold-glow: rgba(200, 169, 81, 0.15);

    /* Greens (Golf!) */
    --green-600: #16803C;
    --green-500: #22C55E;
    --green-400: #4ADE80;
    --green-100: #DCFCE7;

    /* Reds */
    --red-600: #DC2626;
    --red-500: #EF4444;
    --red-100: #FEE2E2;

    /* Neutrals */
    --gray-900: #111827;
    --gray-800: #1F2937;
    --gray-700: #374151;
    --gray-600: #4B5563;
    --gray-500: #6B7280;
    --gray-400: #9CA3AF;
    --gray-300: #D1D5DB;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --gray-50: #F9FAFB;
    --white: #FFFFFF;

    /* Functional */
    --bg-primary: #F0F2F5;
    --bg-card: var(--white);
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-500);
    --text-light: var(--gray-400);
    --border-color: var(--gray-200);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;

    /* Layout */
    --top-bar-height: 64px;
    --sidebar-width: 260px;
    --bottom-tab-height: 80px;

    /* Safe area for iPhone notch */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

img {
    max-width: 100%;
    display: block;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ============================================
   AUTH SCREEN
   ============================================ */
.auth-screen {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    background: var(--navy-800);
}

.auth-hero {
    position: relative;
    height: 45vh;
    min-height: 280px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
}

.auth-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,27,45,0.4) 0%, rgba(15,27,45,0.85) 100%);
}

.auth-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
}

.auth-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--gold-500);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 20px rgba(200, 169, 81, 0.4);
}

.logo-icon {
    font-size: 36px;
    color: var(--navy-800);
}

.auth-title {
    font-family: 'Playfair Display', serif;
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 18px;
    font-weight: 300;
    color: var(--gold-400);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.auth-form-container {
    flex: 1;
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin-top: -24px;
    position: relative;
    z-index: 3;
    padding: 32px 24px;
    display: flex;
    justify-content: center;
}

.auth-form-card {
    width: 100%;
    max-width: 400px;
}

.auth-form-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--navy-800);
}

.auth-form-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    color: var(--text-light);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ============================================
   FORMS & INPUTS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 20px;
    color: var(--gray-400);
    pointer-events: none;
    z-index: 1;
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 48px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition-fast);
    outline: none;
    -webkit-appearance: none;
}

.form-input:focus {
    border-color: var(--gold-500);
    background: var(--white);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.toggle-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    background: var(--white);
}

.toggle-option:has(input:checked) {
    border-color: var(--gold-500);
    background: var(--gold-100);
    color: var(--gold-600);
}

.toggle-option input {
    display: none;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 28px;
    background: var(--gray-300);
    border-radius: 14px;
    transition: var(--transition);
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: var(--white);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.toggle-switch input {
    display: none;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--green-500);
}

.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
    color: var(--navy-800);
    box-shadow: 0 2px 8px rgba(200, 169, 81, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(200, 169, 81, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.97) translateY(0);
}

.btn-outline {
    background: transparent;
    color: var(--navy-600);
    border: 1.5px solid var(--gray-300);
}

.btn-outline:hover {
    border-color: var(--navy-400);
    background: var(--navy-50);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 12px 20px;
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--red-500);
    color: var(--white);
}

.btn-danger:hover {
    background: var(--red-600);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-full {
    width: 100%;
}

.btn-icon {
    font-size: 18px;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: inherit;
    transition: var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* ============================================
   APP SHELL LAYOUT
   ============================================ */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Top Bar ---------- */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-bar-height);
    padding-top: var(--safe-top);
    background: var(--navy-800);
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.top-bar-inner {
    height: var(--top-bar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-btn {
    color: var(--white);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    font-size: 28px;
    color: var(--gold-500);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-name {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
}

.brand-sub {
    font-size: 11px;
    color: var(--gold-400);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* User Badge */
.top-bar-right {
    position: relative;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px 4px 4px;
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
    color: var(--white);
}

.user-badge:hover {
    background: rgba(255,255,255,0.08);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gold-500);
    color: var(--navy-800);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
}

.user-badge .material-icons-round {
    font-size: 18px;
    color: var(--gray-400);
}

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 200px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 200;
    animation: dropIn 0.2s ease;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--gray-100);
}

.dropdown-item .material-icons-round {
    font-size: 20px;
    color: var(--gray-500);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.text-danger {
    color: var(--red-500) !important;
}

.text-danger .material-icons-round {
    color: var(--red-500) !important;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 150;
    pointer-events: none;
}

.sidebar.open {
    pointer-events: auto;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.sidebar.open .sidebar-overlay {
    opacity: 1;
}

.sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--navy-800);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding-top: var(--safe-top);
    overflow-y: auto;
}

.sidebar.open .sidebar-nav {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
    flex: 1;
}

.close-sidebar {
    color: var(--gray-400);
}

/* Nav Items */
.nav-list {
    list-style: none;
    padding: 12px 8px;
    flex: 1;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gray-500);
    padding: 20px 12px 8px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-300);
    transition: var(--transition-fast);
}

.nav-item a:hover {
    background: rgba(255,255,255,0.06);
    color: var(--white);
}

.nav-item.active a {
    background: linear-gradient(135deg, rgba(200,169,81,0.15), rgba(200,169,81,0.05));
    color: var(--gold-400);
}

.nav-item.active a .material-icons-round {
    color: var(--gold-500);
}

.nav-item a .material-icons-round {
    font-size: 22px;
    color: var(--gray-500);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.game-info-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(200,169,81,0.1);
    border-radius: var(--radius-md);
    color: var(--gold-400);
    font-size: 12px;
}

.game-info-mini strong {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gold-500);
}

/* ---------- Main Content ---------- */
.main-content {
    margin-top: calc(var(--top-bar-height) + var(--safe-top));
    padding-bottom: var(--bottom-tab-height);
    min-height: calc(100vh - var(--top-bar-height));
    overflow-x: hidden;
    max-width: 100vw;
    box-sizing: border-box;
    flex: 1;
}

/* ---------- Bottom Tabs (iOS-style) ---------- */
.bottom-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-tab-height);
    padding-bottom: var(--safe-bottom);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 0.5px solid rgba(0,0,0,0.1);
    display: flex;
    align-items: flex-start;
    justify-content: space-around;
    z-index: 90;
}

.bottom-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    min-width: 48px;
    color: var(--gray-400);
    transition: var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.bottom-tab .material-icons-round {
    font-size: 22px;
}

.bottom-tab-label {
    font-size: 10px;
    font-weight: 500;
}

.bottom-tab.active {
    color: var(--gold-500);
}

.bottom-tab.active .material-icons-round {
    color: var(--gold-500);
}

/* ============================================
   VIEW SYSTEM
   ============================================ */
.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* View Header (Hero style) */
.view-header {
    position: relative;
    padding: 40px 24px 32px;
    overflow: hidden;
}

.view-header-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.3);
}

.view-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, var(--navy-800) 0%, transparent 30%, rgba(15,27,45,0.9) 100%);
    pointer-events: none;
}

.view-header-content {
    position: relative;
    z-index: 2;
    color: var(--white);
    max-width: 1200px;
    margin: 0 auto;
}

.view-title {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.view-desc {
    font-size: 14px;
    color: var(--gray-300);
}

/* Compact Header */
.view-header.compact {
    background: var(--navy-800);
    padding: 20px 24px;
}

.view-header.compact::after {
    display: none;
}

.view-header.compact .view-title {
    color: var(--white);
}

.view-header.compact .view-desc {
    color: var(--gray-400);
}

.view-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

/* View Body */
.view-body {
    padding: 20px 16px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   STATS CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon .material-icons-round {
    font-size: 22px;
}

.bg-gold {
    background: var(--gold-100);
    color: var(--gold-600);
}

.bg-green {
    background: var(--green-100);
    color: var(--green-600);
}

.bg-navy {
    background: var(--navy-50);
    color: var(--navy-600);
}

.bg-red {
    background: var(--red-100);
    color: var(--red-600);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--navy-800);
    line-height: 1.1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   SECTION CARDS
   ============================================ */
.section-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--gray-100);
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy-800);
}

.section-link {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gold-500);
    cursor: pointer;
}

.section-link .material-icons-round {
    font-size: 16px;
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    padding: 12px 16px 16px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 8px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 12px;
    font-weight: 600;
    color: var(--navy-600);
    -webkit-tap-highlight-color: transparent;
}

.quick-action-btn:hover {
    border-color: var(--gold-400);
    background: var(--gold-100);
    color: var(--gold-600);
}

.quick-action-btn .material-icons-round {
    font-size: 26px;
    color: var(--gold-500);
}

/* ============================================
   UPCOMING GAMES LIST
   ============================================ */
.upcoming-list {
    padding: 8px 16px 16px;
}

.upcoming-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-100);
}

.upcoming-item:last-child {
    border-bottom: none;
}

.upcoming-date-badge {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--navy-800);
    color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upcoming-date-badge .month {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold-400);
}

.upcoming-date-badge .day {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
}

.upcoming-info {
    flex: 1;
    min-width: 0;
}

.upcoming-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--navy-800);
}

.upcoming-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

.upcoming-status {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   ACTIVITY LIST
   ============================================ */
.activity-list {
    padding: 8px 16px 16px;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold-500);
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-text {
    color: var(--text-secondary);
}

.activity-text strong {
    color: var(--text-primary);
}

.activity-time {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

/* ============================================
   SEARCH BAR
   ============================================ */
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    font-size: 20px;
    color: var(--gray-400);
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 46px;
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.06);
    color: var(--white);
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.search-input:focus {
    border-color: var(--gold-500);
    background: rgba(255,255,255,0.1);
}

.search-input::placeholder {
    color: var(--gray-500);
}

/* ============================================
   GOLFER CARDS / LIST
   ============================================ */

/* View toggle buttons */
.view-toggle {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}
.view-toggle-btn {
    background: none;
    border: none;
    padding: 8px 10px;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    transition: var(--transition-fast);
}
.view-toggle-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.view-toggle-btn.active {
    background: var(--navy-800);
    color: var(--gold-400);
}
.view-toggle-btn .material-icons-round {
    font-size: 20px;
}

/* List view (default) */
.golfer-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}
.golfer-list .golfer-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
}
.golfer-list .golfer-row:last-child {
    border-bottom: none;
}
.golfer-list .golfer-row:hover {
    background: var(--bg-hover);
}
.golfer-list .golfer-avatar {
    width: 36px;
    height: 36px;
    font-size: 13px;
}
.golfer-list .golfer-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy-800);
    min-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.golfer-list .golfer-meta {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    font-size: 12px;
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
}
.golfer-list .golfer-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    width: 120px;
    flex-shrink: 0;
}
.golfer-list .golfer-meta-item .material-icons-round {
    font-size: 14px;
    color: var(--text-light);
}
.golfer-list .golfer-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}
.golfer-list .golfer-row:hover .golfer-actions {
    opacity: 1;
}
.golfer-header-row {
    background: var(--navy-800, #1e293b) !important;
    border-bottom: 2px solid var(--gold-500, #C8A951) !important;
    padding: 8px 16px !important;
}
.golfer-header-row:hover {
    background: var(--navy-800, #1e293b) !important;
}
.golfer-header-row .golfer-col-label {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: var(--gold-400, #D4AF37) !important;
}
.golfer-header-row .golfer-meta-item .material-icons-round {
    color: var(--gold-500, #C8A951) !important;
    font-size: 14px;
}
.golfer-header-row .golfer-name {
    color: var(--gold-400, #D4AF37) !important;
}

/* List view: background card wrapper */
.golfer-list {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* Mobile: always show actions (no hover) */
@media (max-width: 768px) {
    .golfer-list .golfer-actions {
        opacity: 1;
    }
    .golfer-list .golfer-row {
        gap: 10px;
        padding: 10px 12px;
    }
    .golfer-list .golfer-name {
        min-width: 100px;
    }
}

/* Grid view */
.golfer-cards {
    display: grid;
    gap: 12px;
    overflow: hidden;
}

.golfer-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition-fast);
    overflow: hidden;
    min-width: 0;
}

.golfer-card:hover {
    box-shadow: var(--shadow-md);
}

.golfer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--navy-800);
    color: var(--gold-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.golfer-details {
    flex: 1;
    min-width: 0;
}

.golfer-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--navy-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.golfer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    overflow: hidden;
}

.golfer-meta-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

.golfer-meta-item .material-icons-round {
    font-size: 14px;
}

.golfer-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.golfer-actions .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.golfer-actions .icon-btn:hover {
    background: var(--gray-100);
}

.golfer-actions .icon-btn .material-icons-round {
    font-size: 20px;
    color: var(--gray-500);
}

.golfer-actions .icon-btn.delete-btn:hover {
    background: var(--red-100);
}

.golfer-actions .icon-btn.delete-btn:hover .material-icons-round {
    color: var(--red-500);
}

/* ============================================
   SCHEDULE
   ============================================ */
.date-chips-wrapper {
    overflow-x: auto;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.date-chips-wrapper::-webkit-scrollbar {
    display: none;
}

.date-chips {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    min-width: max-content;
}

.date-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 18px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition-fast);
    min-width: 72px;
    -webkit-tap-highlight-color: transparent;
}

.date-chip:hover {
    border-color: var(--gold-400);
}

.date-chip.active {
    background: var(--navy-800);
    border-color: var(--navy-800);
    color: var(--white);
}

.date-chip-dow {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.date-chip.active .date-chip-dow {
    color: var(--gold-400);
}

.date-chip-day {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.date-chip-month {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
}

.date-chip.active .date-chip-month {
    color: var(--gray-400);
}

/* Schedule List */
.schedule-list {
    padding: 8px 0;
}

.schedule-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition-fast);
}

.schedule-row:last-child {
    border-bottom: none;
}

.schedule-row:hover {
    background: var(--gray-50);
}

.schedule-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--navy-800);
    color: var(--gold-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.schedule-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.schedule-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.status-pill {
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.status-pill.in {
    background: var(--green-100);
    color: var(--green-600);
    border-color: var(--green-500);
}

.status-pill.out {
    background: var(--red-100);
    color: var(--red-600);
    border-color: var(--red-500);
}

.status-pill.pending {
    background: var(--gray-100);
    color: var(--gray-500);
    border-color: var(--gray-300);
}

.status-pill.paid {
    background: var(--gold-100);
    color: var(--gold-600);
    border-color: var(--gold-500);
}

.status-pill:not(.active-status) {
    opacity: 0.4;
    border-color: transparent;
}

.status-pill.active-status {
    opacity: 1;
}

/* Schedule Stats */
.schedule-stats {
    display: flex;
    gap: 6px;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.badge-green {
    background: var(--green-100);
    color: var(--green-600);
}

.badge-red {
    background: var(--red-100);
    color: var(--red-600);
}

.badge-gold {
    background: var(--gold-100);
    color: var(--gold-600);
}

.badge-navy {
    background: var(--navy-50);
    color: var(--navy-600);
}

/* ============================================
   GROUPS
   ============================================ */
.groups-container {
    display: grid;
    gap: 16px;
}

.group-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--navy-800);
    color: var(--white);
}

.group-tee-time {
    font-size: 18px;
    font-weight: 700;
}

.group-label {
    font-size: 12px;
    color: var(--gold-400);
    font-weight: 500;
}

.group-members {
    padding: 8px 0;
}

.group-member {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--gray-100);
}

.group-member:last-child {
    border-bottom: none;
}

.group-member-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.group-member-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.group-member-hc {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.group-member-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.group-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--navy-50);
    color: var(--navy-600);
    text-decoration: none;
    transition: all 0.15s;
}

.group-contact-btn:hover {
    background: var(--gold-100);
    color: var(--gold-600);
}

.group-contact-btn .material-icons-round {
    font-size: 18px;
}

/* ============================================
   TABS BAR
   ============================================ */
.tabs-bar {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.tab-btn.active {
    background: var(--white);
    color: var(--navy-800);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   RESULTS & STANDINGS
   ============================================ */
.standings-table {
    width: 100%;
    border-collapse: collapse;
}

.standings-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    border-bottom: 2px solid var(--gray-200);
}

.standings-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--gray-100);
}

.standings-table tr:hover td {
    background: var(--gray-50);
}

.rank-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.rank-1 { background: #FFD700; color: #7C6200; }
.rank-2 { background: #C0C0C0; color: #555; }
.rank-3 { background: #CD7F32; color: #5C3A18; }

/* ============================================
   SEASON STANDINGS - ALWAYS VISIBLE
   ============================================ */
.season-standings-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 20px;
}

.season-standings-header {
    background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 100%);
    padding: 20px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.season-standings-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(200,169,81,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.season-standings-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 4px;
    position: relative;
}

.season-standings-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.3px;
    margin: 0;
}

.season-standings-subtitle {
    font-size: 12px;
    color: var(--gold-300);
    font-weight: 500;
    position: relative;
}

/* Top 3 Podium Cards */
.season-podium {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(180deg, var(--navy-800) 0%, transparent 100%);
}

.podium-card {
    text-align: center;
    padding: 20px 12px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}
.podium-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.podium-card.gold {
    border-color: var(--gold-400);
    box-shadow: 0 4px 20px rgba(200,169,81,0.15);
    order: -1;
}
.podium-card.silver {
    border-color: #C0C0C0;
}
.podium-card.bronze {
    border-color: #CD7F32;
}

.podium-rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    margin: 0 auto 10px;
}
.podium-rank.gold-rank { background: linear-gradient(135deg, #FFD700, #FFA500); color: #5C3A00; }
.podium-rank.silver-rank { background: linear-gradient(135deg, #E8E8E8, #B0B0B0); color: #444; }
.podium-rank.bronze-rank { background: linear-gradient(135deg, #E8A060, #CD7F32); color: #4A2800; }

.podium-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podium-earnings {
    font-size: 20px;
    font-weight: 800;
    color: var(--green-600);
    margin-bottom: 6px;
}

.podium-stats {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 11px;
    color: var(--text-light);
}
.podium-stats span {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Full Leaderboard below podium */
.season-leaderboard {
    padding: 0;
}
.season-leaderboard table {
    width: 100%;
    border-collapse: collapse;
}
.season-leaderboard th {
    text-align: left;
    padding: 10px 16px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    border-bottom: 2px solid var(--gray-200);
    background: var(--gray-50);
}
.season-leaderboard td {
    padding: 10px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
}
.season-leaderboard tr:hover td {
    background: rgba(200,169,81,0.04);
}

.season-leaderboard .slb-rank {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    background: var(--gray-100);
    color: var(--gray-600);
}

.season-leaderboard .slb-earnings {
    font-weight: 700;
    color: var(--green-600);
}

.season-standings-footer {
    padding: 14px 20px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Mobile - stack podium */
@media (max-width: 480px) {
    .season-podium {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 16px;
    }
    .podium-card { padding: 14px 12px; display: flex; align-items: center; gap: 12px; text-align: left; }
    .podium-card.gold { order: 0; }
    .podium-rank { margin: 0; width: 36px; height: 36px; flex-shrink: 0; }
    .podium-name { margin-bottom: 0; font-size: 14px; }
    .podium-earnings { font-size: 16px; margin-bottom: 0; }
    .podium-stats { display: none; }
    .podium-card .podium-info { flex: 1; display: flex; align-items: center; justify-content: space-between; }

    .season-standings-title { font-size: 17px; }
    .season-standings-header { padding: 16px; }
}

/* Season Tabs Bar */
.season-tabs-bar {
    display: flex;
    background: var(--navy-800);
    padding: 0 16px;
    gap: 0;
    border-bottom: 1px solid rgba(200,169,81,0.15);
}
.season-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--gold-300);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: color 0.2s, background 0.2s;
    text-align: center;
    letter-spacing: 0.3px;
}
.season-tab:hover {
    background: rgba(200,169,81,0.08);
    color: var(--gold-200);
}
.season-tab.active {
    color: var(--gold-400);
    background: rgba(200,169,81,0.12);
}
.season-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
    border-radius: 3px 3px 0 0;
}

/* Season tab content tables */
.season-tab-table {
    width: 100%;
    border-collapse: collapse;
}
.season-tab-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    border-bottom: 2px solid var(--gray-200);
    background: var(--gray-50);
}
.season-tab-table tbody td {
    padding: 11px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
}
.season-tab-table tbody tr:hover td {
    background: rgba(200,169,81,0.04);
}
.season-tab-table .st-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    background: var(--gray-100);
    color: var(--gray-600);
}
.season-tab-table .st-rank.rank-gold { background: linear-gradient(135deg, #FFD700, #FFA500); color: #5C3A00; }
.season-tab-table .st-rank.rank-silver { background: linear-gradient(135deg, #E8E8E8, #B0B0B0); color: #444; }
.season-tab-table .st-rank.rank-bronze { background: linear-gradient(135deg, #E8A060, #CD7F32); color: #4A2800; }

.season-tab-table .st-name { font-weight: 600; color: var(--text-primary); }
.season-tab-table .st-earnings { font-weight: 700; color: var(--green-600); }
.season-tab-table .st-highlight { font-weight: 600; color: var(--navy-700); }

.season-tab-footer {
    padding: 12px 16px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 480px) {
    .season-tabs-bar { padding: 0 8px; }
    .season-tab { padding: 10px 8px; font-size: 12px; }
    .season-tab-table thead th { padding: 10px 10px; }
    .season-tab-table tbody td { padding: 9px 10px; font-size: 12px; }
}

/* ============================================
   PAYMENTS
   ============================================ */
.payment-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.payment-row:last-child {
    border-bottom: none;
}

.payment-amount {
    font-size: 15px;
    font-weight: 700;
}

.payment-amount.owed {
    color: var(--red-500);
}

.payment-amount.paid {
    color: var(--green-600);
}

.venmo-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #3D95CE;
    color: var(--white);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* ============================================
   MODALS (iOS Sheet Style)
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeInOverlay 0.2s ease;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    background: var(--white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-sm {
    max-width: 400px;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--gray-100);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy-800);
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 16px 24px 24px;
    border-top: 1px solid var(--gray-100);
    position: sticky;
    bottom: 0;
    background: var(--white);
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast {
    position: fixed;
    bottom: calc(var(--bottom-tab-height) + 16px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--navy-800);
    color: var(--white);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 600;
    animation: toastIn 0.3s ease;
    white-space: nowrap;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.toast-icon {
    font-size: 20px;
    color: var(--green-400);
}

.toast.error .toast-icon {
    color: var(--red-500);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-light);
}

.empty-icon {
    font-size: 48px;
    color: var(--gray-300);
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 14px;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-top: 16px;
}

.alert-error {
    background: var(--red-100);
    color: var(--red-600);
    border: 1px solid rgba(239,68,68,0.2);
}

/* ============================================
   SETTINGS FORM
   ============================================ */
.settings-form {
    padding: 20px;
}

.settings-form .form-group {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-100);
}

.settings-form .form-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* ============================================
   PROFILE FORM
   ============================================ */
.profile-form {
    padding: 24px;
}

/* ============================================
   ADMIN-ONLY ELEMENTS (hidden for golfer role)
   ============================================ */
body.role-golfer .admin-only {
    display: none !important;
}

body.role-guest .admin-only {
    display: none !important;
}

/* ============================================
   RESPONSIVE - Tablet & Desktop
   ============================================ */
@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
    }

    .golfer-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .groups-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-overlay {
        align-items: center;
    }

    .modal {
        border-radius: var(--radius-xl);
        max-height: 85vh;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    /* Show sidebar on desktop, hide menu button */
    .sidebar {
        pointer-events: auto;
    }

    .sidebar-nav {
        transform: translateX(0);
        position: fixed;
        z-index: 50;
    }

    .sidebar-overlay {
        display: none;
    }

    .close-sidebar {
        display: none;
    }

    .menu-btn {
        display: none;
    }

    .main-content {
        margin-left: var(--sidebar-width);
        max-width: calc(100vw - var(--sidebar-width));
        overflow-x: hidden;
    }

    .bottom-tabs {
        display: none;
    }

    .main-content {
        padding-bottom: 24px;
    }

    .view-body {
        padding: 24px 32px;
    }

    .golfer-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .groups-container {
        grid-template-columns: repeat(3, 1fr);
    }

    .top-bar {
        left: var(--sidebar-width);
    }

    .brand {
        display: none;
    }
}

@media (min-width: 1400px) {
    .golfer-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   iOS SPECIFIC TWEAKS
   ============================================ */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }

    .modal {
        padding-bottom: var(--safe-bottom);
    }
}

/* Prevent selection on interactive elements */
.btn, .icon-btn, .nav-item, .bottom-tab, .date-chip, .status-pill, .quick-action-btn {
    -webkit-user-select: none;
    user-select: none;
}

/* Smooth scrolling for the whole app */
html {
    scroll-behavior: smooth;
}

/* Focus ring for accessibility */
:focus-visible {
    outline: 2px solid var(--gold-500);
    outline-offset: 2px;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--gold-500);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Rules View ─── */
.rule-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s;
}
.rule-card:last-child {
    border-bottom: none;
}
.rule-card:hover {
    background: var(--gray-50);
}
.rule-num-col {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--navy-800);
    color: var(--gold-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-top: 2px;
}
.rule-num-col.no-num {
    background: var(--gray-100);
    color: var(--gray-400);
}
.rule-num-col.no-num .material-icons-round {
    font-size: 20px;
}
.rule-body-col {
    flex: 1;
    min-width: 0;
}
.rule-body-col h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0 0 4px 0;
}
.rule-body-col p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}
.rule-actions-col {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    margin-top: 2px;
}
.rule-actions-col button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    transition: all 0.15s;
}
.rule-actions-col button:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}
.rule-actions-col button.rule-delete-btn:hover {
    background: var(--red-100);
    color: var(--red-600);
}
.rule-actions-col button .material-icons-round {
    font-size: 18px;
}

/* Grammar button in modal */
.grammar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--navy-50, #EDF1F7);
    color: var(--navy-600);
    border: 1px solid var(--navy-200);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 8px;
}
.grammar-btn:hover {
    background: var(--navy-100);
}
.grammar-btn .material-icons-round {
    font-size: 16px;
}

/* ============================================
   19TH HOLE FEED
   ============================================ */
.feed-composer {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    align-items: flex-start;
}
.feed-composer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--navy-800);
    color: var(--gold-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.feed-composer-input-wrap {
    flex: 1;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.feed-composer-textarea {
    flex: 1;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    background: var(--gray-50);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 42px;
    max-height: 120px;
    transition: border-color 0.15s;
}
.feed-composer-textarea:focus {
    border-color: var(--gold-500);
    background: var(--white);
}
.feed-composer-textarea::placeholder {
    color: var(--gray-400);
}
.feed-post-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--gold-500);
    color: var(--navy-800);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.feed-post-btn:disabled {
    opacity: 0.35;
    cursor: default;
}
.feed-post-btn:not(:disabled):hover {
    background: var(--gold-400);
    transform: scale(1.05);
}
.feed-post-btn .material-icons-round {
    font-size: 20px;
}

/* Feed Posts */
.feed-post {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
    align-items: flex-start;
}
.feed-post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--navy-800);
    color: var(--gold-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.feed-post-body {
    flex: 1;
    min-width: 0;
}
.feed-post-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.feed-post-author {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy-800);
}
.feed-post-time {
    font-size: 12px;
    color: var(--text-light);
}
.feed-post-message {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.feed-post-actions {
    display: flex;
    gap: 4px;
    margin-top: 10px;
    align-items: center;
}
.feed-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: none;
    background: none;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.feed-action-btn:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}
.feed-action-btn .material-icons-round {
    font-size: 16px;
}
.feed-delete-btn:hover {
    background: var(--red-100) !important;
    color: var(--red-600) !important;
}

/* Replies */
.feed-replies-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}
.feed-reply {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    align-items: flex-start;
}
.feed-reply-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}
.feed-reply-body {
    flex: 1;
    min-width: 0;
}
.feed-reply-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--navy-800);
    margin-right: 6px;
}
.feed-reply-time {
    font-size: 11px;
    color: var(--text-light);
}
.feed-reply-message {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    margin-top: 2px;
    word-wrap: break-word;
}
.feed-reply-composer {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}
.feed-reply-input {
    flex: 1;
    height: 36px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-full);
    padding: 0 14px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    background: var(--gray-50);
    color: var(--text-primary);
    transition: border-color 0.15s;
}
.feed-reply-input:focus {
    border-color: var(--gold-500);
    background: var(--white);
}
.feed-reply-input::placeholder {
    color: var(--gray-400);
}
.feed-reply-send {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--gold-500);
    color: var(--navy-800);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.feed-reply-send:hover {
    background: var(--gold-400);
}
.feed-reply-send .material-icons-round {
    font-size: 16px;
}

/* ============================================
   EMAIL BLASTS
   ============================================ */
.blast-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-light);
    margin: 0 0 12px;
}
.blast-templates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}
.blast-template-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.blast-template-card:hover {
    border-color: var(--gold-400);
    box-shadow: var(--shadow-sm);
}
.blast-template-card.active {
    border-color: var(--gold-500);
    background: var(--gold-100);
}
.blast-template-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--navy-800);
    color: var(--gold-400);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.blast-template-icon .material-icons-round {
    font-size: 22px;
}
.blast-template-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 2px;
}
.blast-template-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}
.blast-template-check {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    color: var(--gold-500);
    opacity: 0;
    transition: opacity 0.15s;
}
.blast-template-card.active .blast-template-check {
    opacity: 1;
}
.blast-history-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
}
.blast-history-row:last-child {
    border-bottom: none;
}
.blast-history-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--navy-50);
    color: var(--navy-600);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.blast-history-icon .material-icons-round {
    font-size: 18px;
}
.blast-history-subject {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 2px;
}
.blast-history-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================
   AVAILABILITY
   ============================================ */
.avail-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.avail-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border-radius: 14px;
    background: var(--white);
    border: 1px solid var(--gray-100);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.avail-stat-num {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}
.avail-stat-lbl {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.avail-stat-in .avail-stat-num { color: #16a34a; }
.avail-stat-in .avail-stat-lbl { color: #22c55e; }
.avail-stat-in { background: linear-gradient(135deg, #f0fdf4, #dcfce7); border-color: #bbf7d0; }
.avail-stat-out .avail-stat-num { color: #dc2626; }
.avail-stat-out .avail-stat-lbl { color: #ef4444; }
.avail-stat-out { background: linear-gradient(135deg, #fef2f2, #fee2e2); border-color: #fecaca; }
.avail-stat-tbd .avail-stat-num { color: #9ca3af; }
.avail-stat-tbd .avail-stat-lbl { color: #9ca3af; }
.avail-stat-tbd { background: linear-gradient(135deg, #f9fafb, #f3f4f6); border-color: #e5e7eb; }

.avail-card {
    overflow: hidden;
    padding: 0 !important;
}
.avail-row {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    gap: 14px;
    transition: background 0.15s;
}
.avail-row:last-child {
    border-bottom: none;
}
.avail-row:hover {
    background: rgba(0,0,0,0.015);
}
.avail-past {
    opacity: 0.5;
}

/* Calendar chip */
.avail-date-chip {
    width: 46px;
    height: 50px;
    border-radius: 10px;
    background: var(--gray-50, #f9fafb);
    border: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.avail-date-month {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary, #b8860b);
    line-height: 1;
    margin-bottom: 2px;
}
.avail-date-day {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

/* Date info */
.avail-date-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.avail-date-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.avail-status-text {
    font-size: 12px;
    font-weight: 500;
}
.avail-text-in { color: #16a34a; }
.avail-text-out { color: #dc2626; }
.avail-text-tbd { color: #9ca3af; }

/* Action buttons */
.avail-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.avail-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    color: #c0c5cc;
}
.avail-btn .material-icons-round {
    font-size: 18px;
}
.avail-btn:hover {
    border-color: var(--gray-300);
    color: var(--text-secondary);
    transform: scale(1.08);
}
.avail-btn-in.active {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
    box-shadow: 0 2px 8px rgba(22,163,74,0.3);
}
.avail-btn-in.active:hover {
    background: #15803d;
    border-color: #15803d;
}
.avail-btn-out.active {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
    box-shadow: 0 2px 8px rgba(220,38,38,0.3);
}
.avail-btn-out.active:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}
/* Dim inactive when one is chosen - using JS fallback since :has() not supported on older iOS */
.avail-btn:not(.active) {
    transition: opacity 0.18s ease;
}

@media (max-width: 480px) {
    .avail-summary { gap: 8px; }
    .avail-stat { padding: 12px 8px; }
    .avail-stat-num { font-size: 22px; }
    .avail-row { padding: 12px 14px; gap: 10px; }
    .avail-date-chip { width: 40px; height: 44px; }
    .avail-date-day { font-size: 17px; }
    .avail-date-month { font-size: 9px; }
    .avail-btn { width: 36px; height: 36px; }
    .avail-btn .material-icons-round { font-size: 16px; }
}

/* ============================================
   GROUP TEXT BUTTON (at group header level)
   ============================================ */
.group-text-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--navy-800);
    color: var(--gold-400);
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}
.group-text-btn:hover {
    background: var(--navy-600);
}
.group-text-btn .material-icons-round {
    font-size: 16px;
}

/* ============================================
   GROUP EDIT CONTROLS (Set Pairings)
   ============================================ */
.group-edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    color: var(--gray-500);
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}
.group-edit-btn:hover {
    background: var(--gold-100);
    color: var(--gold-600);
}
.group-edit-btn .material-icons-round {
    font-size: 16px;
}
.group-remove-member-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: none;
    color: var(--gray-400);
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    margin-left: auto;
    flex-shrink: 0;
}
.group-remove-member-btn:hover {
    background: var(--red-100);
    color: var(--red-600);
}
.group-remove-member-btn .material-icons-round {
    font-size: 16px;
}
.group-add-slot-btn {
    display: inline-flex;
    align-items: center;
    background: none;
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 12px;
    transition: all 0.15s;
}
.group-add-slot-btn:hover {
    border-color: var(--gold-400);
    color: var(--gold-600);
    background: var(--gold-100);
}

/* Add Golfer slot on Groupings page */
.add-golfer-slot:hover {
    background: var(--gold-100, rgba(200, 169, 81, 0.08));
}
.add-golfer-slot:active {
    background: var(--gold-100, rgba(200, 169, 81, 0.15));
}

/* Add Golfer modal search input wrapper */
#addGolferModal .modal-body > div:first-child {
    position: relative;
}

/* ============================================
   DESKTOP LAYOUT FIXES (Rules, Feed, Groups)
   ============================================ */
@media (min-width: 768px) {
    /* Rules: constrain card width on desktop */
    #view-rules .view-body,
    #view-feed .view-body {
        max-width: 800px;
    }

    /* Feed posts: better spacing on desktop */
    .feed-post {
        padding: 20px 24px;
    }
    .feed-composer {
        padding: 20px 24px;
    }

    /* Rule cards: better spacing on desktop */
    .rule-card {
        padding: 18px 24px;
    }
}

@media (min-width: 1024px) {
    #view-rules .view-body,
    #view-feed .view-body {
        max-width: 800px;
    }
}

/* ============================================
   IPHONE / SAFARI SPECIFIC FIXES
   ============================================ */

/* Fix 100vh issue on iOS Safari (URL bar pushes content) */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
    .auth-screen {
        min-height: -webkit-fill-available;
    }
    .main-content {
        min-height: -webkit-fill-available;
    }

    /* Fix bottom tabs being cut off by iPhone home indicator */
    .bottom-tabs {
        padding-bottom: max(var(--safe-bottom), 16px);
        height: calc(var(--bottom-tab-height) + var(--safe-bottom));
    }

    .main-content {
        padding-bottom: calc(var(--bottom-tab-height) + var(--safe-bottom) + 8px);
    }

    /* Fix modal scrolling on iOS */
    .modal {
        -webkit-overflow-scrolling: touch;
    }
    .modal-content {
        -webkit-overflow-scrolling: touch;
        max-height: calc(100vh - var(--safe-top) - var(--safe-bottom) - 40px);
        max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 40px);
    }

    /* Fix backdrop-filter for iOS */
    .top-bar,
    .bottom-tabs {
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
    }

    /* Ensure touch targets are large enough */
    .btn, .icon-btn, .status-pill, .avail-btn, .date-chip {
        min-height: 44px;
        min-width: 44px;
    }

    /* Fix sticky position for iOS Safari */
    .top-bar {
        position: -webkit-sticky;
        position: sticky;
    }
}

/* Small iPhone screens (SE, Mini, etc.) */
@media (max-width: 375px) {
    .top-bar {
        padding: 0 12px;
        height: 56px;
    }

    .view-header h1.view-title {
        font-size: 20px;
    }

    .view-header .view-desc {
        font-size: 12px;
    }

    .section-card {
        border-radius: var(--radius-md);
    }

    /* Smaller golfer cards on tiny screens */
    .golfer-card {
        padding: 12px;
    }

    .golfer-avatar {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .golfer-name {
        font-size: 14px;
    }

    /* Schedule controls need to wrap better */
    .schedule-row {
        flex-wrap: wrap;
    }

    .schedule-controls {
        flex-wrap: wrap;
        gap: 4px;
    }

    .status-pill {
        padding: 4px 10px;
        font-size: 11px;
        min-height: 32px;
        min-width: 32px;
    }

    /* Tabs bar needs horizontal scroll */
    .tabs-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 4px;
    }

    .tab-btn {
        font-size: 12px;
        padding: 8px 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Bottom tabs smaller */
    .bottom-tab-label {
        font-size: 9px;
    }

    .bottom-tab .material-icons-round {
        font-size: 20px;
    }

    /* Groups view */
    .group-card {
        border-radius: var(--radius-md);
    }

    .group-header {
        padding: 12px 14px;
    }

    .group-member {
        padding: 8px 14px;
    }

    /* Date chips smaller */
    .date-chip {
        padding: 8px 10px;
        min-width: 52px;
    }
}

/* Use dvh (dynamic viewport height) where supported - fixes iPhone URL bar issue */
@supports (height: 100dvh) {
    .auth-screen {
        min-height: 100dvh;
    }
    body {
        min-height: 100dvh;
    }
    .modal-content {
        max-height: calc(100dvh - 80px);
    }
}

/* Fix for tables overflowing on small screens */
@media (max-width: 480px) {
    .standings-table {
        font-size: 12px;
    }
    .standings-table th,
    .standings-table td {
        padding: 8px 6px;
    }
    .standings-table th:nth-child(n+3),
    .standings-table td:nth-child(n+3) {
        text-align: center;
    }
}

/* ---------- Drag & Drop for Group Members ---------- */
.draggable-member {
    cursor: grab;
    transition: opacity 0.2s, background 0.2s, transform 0.2s;
    user-select: none;
    -webkit-user-select: none;
}
.draggable-member:active {
    cursor: grabbing;
}
.draggable-member.dragging {
    opacity: 0.35;
    background: var(--gray-100, #F3F4F6);
    transform: scale(0.97);
}

.drag-handle {
    touch-action: none;
}

/* Drop zone hints while dragging */
.drop-zone {
    transition: box-shadow 0.25s, border-color 0.25s, transform 0.2s;
}
.drop-zone.drop-target-hint {
    border-color: var(--gold-400, #D4BA6A);
    box-shadow: 0 0 0 2px rgba(200, 169, 81, 0.25);
}
.drop-zone.drop-target-active {
    border-color: var(--gold-500, #C8A951);
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.45), 0 4px 16px rgba(200, 169, 81, 0.2);
    transform: scale(1.01);
}

/* Touch drag floating clone */
.touch-drag-clone {
    position: absolute;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.9;
    background: var(--bg-card, #fff);
    border-radius: var(--radius-md, 10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2), 0 0 0 2px var(--gold-500, #C8A951);
    padding: 10px 14px;
    transform: rotate(-2deg);
}

/* ---------- Import Results Tabs ---------- */
.import-tab {
    background: transparent;
    color: var(--text-light, #6B7280);
    transition: all 0.15s;
}
.import-tab.active, .import-tab[style*="box-shadow"] {
    background: var(--white, #fff);
    color: var(--navy-800, #0F1B2D);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.import-tab:hover {
    color: var(--navy-600, #1B2D4A);
}

#importResultsTextInput:focus {
    border-color: var(--gold-500, #C8A951);
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.15);
}

/* ---- Tracking Tables ---- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table thead th {
    background: var(--navy-900, #0F1B2D);
    color: var(--gold-500, #C8A951);
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.data-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: var(--text-primary, #E2E8F0);
    white-space: nowrap;
}
.data-table tbody tr:hover td {
    background: rgba(200, 169, 81, 0.05);
}
@media (max-width: 768px) {
    .data-table { font-size: 12px; }
    .data-table thead th { padding: 10px 8px; }
    .data-table tbody td { padding: 8px; }
}

/* ============================================
   BUGS & ENHANCEMENTS TRACKER
   ============================================ */

/* Filter bar */
.tracker-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.tracker-filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}
.tracker-filter-btn:hover {
    border-color: var(--gold-500);
    color: var(--gold-600);
}
.tracker-filter-btn.active {
    background: var(--navy-800);
    color: var(--gold-400);
    border-color: var(--navy-800);
}

/* Tracker item row */
.trk-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    transition: var(--transition-fast);
}
.trk-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gold-300, #e0c96e);
}
.trk-item.trk-complete {
    opacity: 0.55;
    background: var(--bg-body, #f8f9fa);
}
.trk-item.trk-complete .trk-desc {
    text-decoration: line-through;
    color: var(--text-light);
}
.trk-item.trk-inprogress {
    border-left: 4px solid var(--gold-500, #C8A951);
}

/* Checkbox */
.trk-check {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
    color: var(--text-light);
    transition: var(--transition-fast);
    margin-top: 1px;
}
.trk-check:hover {
    color: var(--gold-500);
    transform: scale(1.15);
}
.trk-complete .trk-check {
    color: var(--green-500, #22c55e);
}
.trk-check .material-icons-round {
    font-size: 22px;
}

/* Content */
.trk-content {
    flex: 1;
    min-width: 0;
}
.trk-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.trk-id {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light);
}
.trk-section {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--gray-100, #f1f5f9);
    padding: 2px 8px;
    border-radius: 4px;
}
.trk-desc {
    font-size: 14px;
    color: var(--text-primary, var(--navy-800));
    line-height: 1.5;
    margin-bottom: 6px;
}
.trk-comments {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--gray-50, #f8fafc);
    border-left: 3px solid var(--gold-300, #e0c96e);
    padding: 6px 10px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 8px;
    line-height: 1.4;
}
.trk-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-light);
}

/* Badges */
.trk-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
}
.trk-badge-bug {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.trk-badge-enh {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}
.trk-badge-high {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.trk-badge-low {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Status dropdown */
.trk-status-select {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    background: var(--bg-card);
    color: var(--text-secondary);
    outline: none;
}
.trk-status-select:focus {
    border-color: var(--gold-500);
}
.trk-status-outstanding {
    color: #ea580c;
    border-color: #fed7aa;
    background: #fff7ed;
}
.trk-status-inprogress {
    color: #C8A951;
    border-color: #C8A951;
    background: #fffbeb;
}
.trk-status-complete {
    color: #16a34a;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

/* Actions */
.trk-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}
.trk-item:hover .trk-actions {
    opacity: 1;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .trk-item {
        padding: 12px 14px;
        gap: 10px;
    }
    .trk-actions {
        opacity: 1;
    }
    .trk-title-row {
        gap: 4px;
    }
    .tracker-filters {
        gap: 4px;
    }
    .tracker-filter-btn {
        padding: 4px 10px;
        font-size: 11px;
    }
}
