/* ================================================================
   TRCC Web UI — Modern Professional Stylesheet
   ================================================================ */

/* Design Tokens */
:root {
  --primary:        #1a5c2e;
  --primary-light:  #2d7a45;
  --primary-dark:   #0d3318;
  --accent:         #b8962e;
  --accent-light:   #d4af50;
  --bg:             #f4f6f4;
  --surface:        #ffffff;
  --surface-alt:    #f0f4f1;
  --border:         #d0d9d2;
  --text:           #1c2b1e;
  --text-muted:     #5a6b5c;
  --text-light:     #8a9b8c;

  --success:        #15613a;
  --success-bg:     #dcf5e7;
  --success-border: #a3d9b8;
  --warning:        #7c5200;
  --warning-bg:     #fef5dc;
  --warning-border: #f5d98a;
  --error:          #8b1a1a;
  --error-bg:       #fde8e8;
  --error-border:   #f5a3a3;
  --info:           #1a4a7c;
  --info-bg:        #e4eeff;
  --info-border:    #a3bdf5;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.08);
  --shadow:    0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.13);

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  --transition: 0.18s ease;
  --nav-h: 64px;
}

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }

ul { list-style: none; }
li { margin: 0; }

/* ── Layout ───────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

main {
  flex: 1;
  padding: 36px 0 60px;
}

/* ── Header / Nav ─────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary-dark);
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  height: var(--nav-h);
}

header .container {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-decoration: none;
}

.brand-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.brand span { color: var(--accent-light); }

nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

nav a svg {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
nav a:hover svg { opacity: 1; }
nav a.active { background: rgba(255,255,255,0.14); color: #fff; }
nav a.active svg { opacity: 1; }

/* ── Account dropdown ─────────────────────────────────────────── */
.nav-user-menu {
  position: relative;
  margin-left: auto;
}

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.nav-user-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-user-btn:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.38);
  color: #fff;
}

.nav-user-chevron {
  transition: transform 0.2s;
}
.nav-user-menu.open .nav-user-chevron {
  transform: rotate(180deg);
}

.nav-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: 200;
  /* Add padding-top to create invisible hover area */
  padding-top: 4px;
  margin-top: -4px;
}
.nav-user-menu.open .nav-user-dropdown {
  display: block;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.12s;
}
.nav-dropdown-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-muted); }
.nav-dropdown-item:hover { 
  background: var(--surface-alt); 
  color: var(--text);
}
.nav-dropdown-item.active { 
  background: var(--surface-alt); 
  font-weight: 600; 
  color: var(--text);
}

.nav-dropdown-divider {
  height: 1px;
  background: rgba(0,0,0,0.08);
  margin: 4px 0;
}

.nav-dropdown-signout { color: #c0392b; }
.nav-dropdown-signout svg { color: #c0392b; }
.nav-dropdown-signout:hover { background: #fdf2f2; }

/* ── Flash Messages ───────────────────────────────────────────── */
.flash-messages { margin-bottom: 28px; display: flex; flex-direction: column; gap: 10px; }

.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 500;
  border-left: 4px solid transparent;
  line-height: 1.5;
}

.flash::before {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.flash-success  { background: var(--success-bg);  color: var(--success);  border-left-color: var(--success); }
.flash-success::before { content: '✓'; }
.flash-error    { background: var(--error-bg);    color: var(--error);    border-left-color: var(--error); }
.flash-error::before   { content: '✕'; }
.flash-warning  { background: var(--warning-bg);  color: var(--warning);  border-left-color: var(--accent); }
.flash-warning::before { content: '⚠'; }
.flash-info     { background: var(--info-bg);     color: var(--info);     border-left-color: var(--info); }
.flash-info::before    { content: 'i'; font-style: italic; font-weight: 700; }

/* ── Alert Banners ────────────────────────────────────────────── */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-size: 0.92rem;
  line-height: 1.6;
}

.alert strong {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.alert p {
  margin: 0;
}

.alert-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning-border);
}

.alert-info {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border);
  border-left: 4px solid var(--info);
  margin: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

.alert-with-icon {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 20px;
}

.alert-icon-large {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-with-icon p {
  margin: 4px 0 0 0;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}

.alert-error {
  background: var(--error-bg);
  color: var(--error);
  border-color: var(--error-border);
}

.alert-cached {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border);
  border-left: 4px solid var(--primary-light);
  margin: 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

.alert-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
  min-width: 0;
}

.alert-content strong {
  display: block;
  margin-bottom: 2px;
}

.alert-timestamp {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.alert-description {
  font-size: 0.85rem;
  color: var(--text);
  display: block;
}

.alert-action {
  flex-shrink: 0;
}

.alert-action .btn {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: var(--primary);
  padding: 6px 10px;
  min-height: 32px;
}

.alert-action .btn:hover {
  background: rgba(255, 255, 255, 0.5);
  border-color: var(--primary);
}

.btn-refresh-small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-refresh-small:hover {
  background: rgba(255, 255, 255, 0.5);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.btn-icon {
  width: 14px;
  height: 14px;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn, button[type="submit"] {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  user-select: none;
  white-space: nowrap;
}

.btn:active, button[type="submit"]:active { transform: translateY(1px); }
.btn:disabled, button:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; transform: none; }

.btn-primary, button[type="submit"] {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover, button[type="submit"]:hover {
  background: var(--primary-light);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-alt);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-sm { padding: 7px 16px; font-size: 0.84rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem; }

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1.5px solid var(--error-border);
}
.btn-danger:hover {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ── Page Headers ─────────────────────────────────────────────── */
.page-header {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.page-header h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── Forms ────────────────────────────────────────────────────── */
.form-container { max-width: 520px; }

.form-group { margin-bottom: 22px; }

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  box-sizing: border-box;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a6b5c' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(45, 122, 69, 0.12);
}

small {
  display: block;
  margin-top: 5px;
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.4;
}

/* Checkbox */
.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
}

input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ── Dashboard ────────────────────────────────────────────────── */
.dashboard-welcome {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.dashboard-welcome::after {
  content: '⛳';
  position: absolute;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 5rem;
  opacity: 0.12;
  pointer-events: none;
}

.dashboard-welcome h2 {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.dashboard-welcome p {
  font-size: 0.95rem;
  opacity: 0.8;
  max-width: 480px;
}

.member-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  margin-top: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
}

/* When the entire card is a link */
a.dashboard-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.dashboard-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  color: var(--primary);
  transition: background 0.2s, color 0.2s;
}
.dashboard-card-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.75;
}
.dashboard-card:hover .dashboard-card-icon {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.dashboard-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.01em;
}

.dashboard-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.dashboard-card .btn {
  align-self: flex-start;
  margin-top: 8px;
}

/* ── Info Box ─────────────────────────────────────────────────── */
.info-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 28px;
}

.info-box h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-box p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 8px; }
.info-box p:last-child { margin-bottom: 0; }

.info-box ul {
  list-style: disc;
  padding-left: 18px;
  margin: 8px 0;
}

.info-box ul li {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  list-style: disc;
}

.info-box-warn {
  border-left-color: var(--accent);
  background: #fdfaf2;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  margin-top: 0;
}

/* ── Disclaimer Banner ────────────────────────────────────────── */
.disclaimer-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--warning);
}

.disclaimer-banner strong {
  font-weight: 600;
  color: var(--warning);
}

/* ── Tee Times ────────────────────────────────────────────────── */
.tee-times-container { display: flex; flex-direction: column; gap: 24px; }

.tee-times-form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.tee-times-section {}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-header .count-badge {
  background: rgba(255,255,255,0.5);
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.section-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.tee-times-section.available .section-header { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); border-bottom: none; }
.tee-times-section.booked    .section-header { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); border-bottom: none; }
.tee-times-section.unavailable .section-header { background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border); border-bottom: none; }

/* ── Weather Banner (sub-header strip) ───────────────────────────── */
.weather-banner {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.weather-banner-icon { font-size: 1rem; }
.weather-banner-desc { font-weight: 600; color: var(--text); }
.weather-banner-sep  { opacity: 0.4; }
.weather-tod-group   { display: flex; align-items: center; gap: 10px; }
.weather-tod-item    { white-space: nowrap; }
.weather-tod-label   { font-weight: 600; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; margin-right: 2px; }
.weather-banner-rating {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.weather-great { background: #d1fae5; color: #065f46; }
.weather-good  { background: #dbeafe; color: #1e40af; }
.weather-fair  { background: #fef3c7; color: #92400e; }
.weather-poor  { background: #fee2e2; color: #991b1b; }


.tee-time-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.tee-time-item:last-child { border-bottom: none; }

.tee-time-main {}

.tee-time-time {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.tee-time-players {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.tee-time-meta {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.spots-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.tee-times-section.available .spots-badge { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── Date tabs (outer level for multi-day view) ───────────────── */
.date-tabs { 
  padding: 0; 
  overflow: hidden;
}

.date-tab-bar {
  display: flex;
  gap: 8px;
  padding: 16px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  /* Smooth scrolling on touch devices */
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Scrollbar styling for date tabs */
.date-tab-bar::-webkit-scrollbar {
  height: 6px;
}

.date-tab-bar::-webkit-scrollbar-track {
  background: var(--surface-alt);
}

.date-tab-bar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.date-tab-bar::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.date-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  min-width: 90px;
}

.date-tab:hover {
  border-color: var(--primary-light);
  background: var(--surface-alt);
}

.date-tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.date-tab-day {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.date-tab.active .date-tab-day {
  opacity: 1;
}

.date-tab-date {
  font-size: 0.95rem;
  font-weight: 700;
}

.date-tab-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--success);
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.date-panel {
  display: none;
}

.date-panel.active {
  display: block;
}

/* ── Tee time tabs (view page) ────────────────────────────────── */
.tt-tabs { padding: 0; overflow: hidden; }

.tt-tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.tt-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.tt-tab:hover:not([disabled]) { color: var(--text); background: var(--surface); }
.tt-tab[disabled] { opacity: 0.4; cursor: default; }
.tt-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--surface); }

.tt-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--border);
  color: var(--text-muted);
}
.tt-badge-available { background: var(--success-bg); color: var(--success); }
.tt-badge-booked    { background: var(--warning-bg); color: var(--warning); }

.tt-panel { display: none; }
.tt-panel.active { display: block; }

/* ── Small button variant ─────────────────────────────────────── */
.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* ── Modal ────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-backdrop[hidden] { display: none; }

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.modal-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: color var(--transition), background var(--transition);
}
.modal-close:hover { color: var(--text); background: var(--surface-alt); }

.modal-time-display {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  padding: 10px 0 18px;
  letter-spacing: 0.02em;
}

.modal-body  { padding: 18px 22px; }
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
}

/* ── Admin Table ──────────────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.admin-table tbody tr {
  border-bottom: 1px solid var(--border);
}

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

.admin-table tbody tr:hover {
  background: var(--surface-alt);
}

.admin-table td {
  padding: 12px 16px;
  font-size: 0.92rem;
  vertical-align: middle;
}

.admin-table td.td-mono {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-table td.td-muted {
  color: var(--text-muted);
  font-size: 0.88rem;
}

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

.card-row-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0;
}

.card-table-body {
  padding: 0;
}

/* ── Auth Form ────────────────────────────────────────────────── */
/* Narrow, centred form used on login and register pages */
.auth-form {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  text-align: left;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ── Config Error / Login ─────────────────────────────────────── */
.config-page {
  max-width: 560px;
  margin: 60px auto;
  text-align: center;
}

.config-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  line-height: 1;
}

.config-page h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.config-page > p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.config-instructions {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.config-instructions h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 14px;
}

.config-instructions p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.config-instructions code {
  font-family: var(--font-mono);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.85em;
  color: var(--primary-dark);
}

.config-instructions pre {
  background: var(--primary-dark);
  color: #a8ffbd;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin: 14px 0;
  overflow-x: auto;
  line-height: 1.7;
}

/* ── Error Page ───────────────────────────────────────────────── */
.error-page {
  max-width: 500px;
  margin: 60px auto;
  text-align: center;
}

.error-code-display {
  font-size: 5rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.05em;
  line-height: 1;
  margin-bottom: 8px;
  opacity: 0.25;
}

.error-page h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.error-page p {
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ── Footer ───────────────────────────────────────────────────── */
footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.45);
  padding: 18px 24px;
  font-size: 0.8rem;
}

footer strong { color: rgba(255,255,255,0.7); }

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-left {
  flex: 1;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: rgba(255,255,255,0.9);
}

.footer-separator {
  color: rgba(255,255,255,0.3);
}

@media (max-width: 640px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-left {
    flex: none;
  }
}

/* ── Section Label ────────────────────────────────────────────── */
.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ── Group Cards (Players page) ───────────────────────────────── */
.new-group-card { margin-bottom: 28px; }

.new-group-inner {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.new-group-label {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 7px;
  display: block;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.group-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.group-header-info { flex: 1; min-width: 0; }
.group-header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.group-name { font-size: 1rem; font-weight: 700; color: var(--primary-dark); }
.group-count { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

.group-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── Rename popover (details/summary toggle, no JS) ── */
.group-rename-details {
  position: relative;
}

.group-rename-details summary {
  list-style: none;
}
.group-rename-details summary::-webkit-details-marker { display: none; }

.btn-icon {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.82rem;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  padding: 0;
}
.btn-icon:hover {
  background: var(--surface-alt);
  color: var(--primary);
  border-color: var(--primary);
}

.group-rename-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  padding: 12px;
  min-width: 220px;
}

.group-rename-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.group-rename-form input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}
.group-rename-form input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26,92,46,.15);
}

.btn-group-delete {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  padding: 0;
}

.btn-group-delete:hover {
  background: var(--error-bg);
  color: var(--error);
  border-color: var(--error-border);
}

.group-empty {
  padding: 14px 20px;
  font-size: 0.84rem;
  color: var(--text-muted);
  font-style: italic;
}

.add-player-inline {
  border-top: 1px dashed var(--border);
  padding: 20px;
  background: var(--bg);
}

.add-player-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.no-groups-placeholder { text-align: center; padding: 48px 24px; }
.no-groups-icon { font-size: 3rem; margin-bottom: 16px; }
.no-groups-placeholder h3 { font-size: 1.1rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 8px; }
.no-groups-placeholder p { font-size: 0.9rem; color: var(--text-muted); max-width: 400px; margin: 0 auto; }

/* ── Group Selector (Book page) ───────────────────────────────── */
.group-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}

.group-option {
  display: block;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  background: var(--surface);
  position: relative;
}

.group-option input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }

.group-option:hover { border-color: var(--primary-light); background: var(--surface-alt); }

.group-option:has(input:checked) {
  border-color: var(--primary);
  background: #f0f7f2;
  box-shadow: 0 0 0 1px var(--primary);
}

.group-option-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.group-option-name { font-size: 0.95rem; font-weight: 700; color: var(--primary-dark); }
.group-option-count { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; white-space: nowrap; }

.group-option-players { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 5px; }

.group-option-players li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  font-size: 0.83rem;
  color: var(--text);
  list-style: none;
}

.group-option-players li .player-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.group-option-solo { font-size: 0.82rem; color: var(--text-muted); font-style: italic; margin: 0; }

.book-datetime { display: flex; gap: 20px; flex-wrap: wrap; }
.book-datetime .form-group { flex: 1; min-width: 160px; margin-bottom: 0; }

/* ── Responsive ───────────────────────────────────────────────── */
/* ── Book Page Layout ─────────────────────────────────────────── */
.book-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.book-sidebar { display: flex; flex-direction: column; gap: 16px; }

.players-sidebar-card {}

.players-sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

/* ── Players Page Layout ──────────────────────────────────────── */
.players-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 24px;
  align-items: start;
}

.players-card {}
.add-player-card {}

.edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.player-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.add-group-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.add-group-input {
  flex: 1;
  min-width: 0;
}

/* ── Player List ──────────────────────────────────────────────── */
.player-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.player-item:last-child { border-bottom: none; }
.player-item:nth-child(even) { background: var(--surface-alt); }

.player-info { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; flex: 1; min-width: 0; }

.player-name {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.player-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.player-phone { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }

.player-carrier-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}
.player-carrier-badge--missing {
  background: var(--surface-alt);
  color: var(--text-light);
  border-color: var(--border);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.resource-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.resource-walk { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.resource-cart { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }

/* Helper text next to form labels */
.label-hint { font-weight: 400; color: var(--text-light); font-size: 0.85em; }

/* "Add player to group" inline form at the bottom of each group card */
.add-member-form {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 20px 16px;
  border-top: 1px dashed var(--border);
  margin-top: 4px;
}
.add-member-form select {
  flex: 1;
  min-width: 0;
}

.btn-remove {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  padding: 0;
}

.btn-remove svg {
  stroke: var(--text-muted);
}

.btn-remove:hover {
  background: var(--error-bg);
  color: var(--error);
  border-color: var(--error);
}

.btn-remove:hover svg {
  stroke: var(--error);
}

.no-players {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.no-players a { color: var(--primary); font-weight: 600; }

/* Compact list variant (sidebar) */
.player-list-compact .player-item-compact {
  padding: 10px 14px;
}

.player-list-compact .player-name {
  font-size: 0.87rem;
}

/* Resource radio select */
.resource-select {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.resource-option {
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
}

.resource-option input[type="radio"] { display: none; }

.resource-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  background: var(--surface);
  color: var(--text-muted);
}

.resource-label svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.resource-option input[type="radio"]:checked + .resource-label {
  border-color: var(--primary);
  background: var(--surface-alt);
  color: var(--primary-dark);
  font-weight: 700;
}

.resource-option input[type="radio"]:checked + .resource-label svg {
  opacity: 1;
}

.resource-label:hover { border-color: var(--primary-light); color: var(--primary); }
.resource-label:hover svg { opacity: 1; }

/* ── Status Badges (scheduled bookings) ───────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-pending {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}
.status-booked {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}
.status-failed {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error-border);
}
.status-cancelled,
.status-expired {
  background: var(--surface-alt);
  color: var(--text-light);
  border: 1px solid var(--border);
}

/* ── Loading Overlay ──────────────────────────────────────────── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(13, 51, 24, 0.70);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.loading-overlay.active { display: flex; }

.loading-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  min-width: 280px;
  max-width: 360px;
  width: 100%;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--surface-alt);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: loading-spin 0.85s linear infinite;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

.loading-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.loading-status {
  font-size: 0.88rem;
  color: var(--text-muted);
  min-height: 1.4em;
  transition: opacity 0.25s ease;
}

.loading-elapsed {
  margin-top: 18px;
  font-size: 0.75rem;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

@media (max-width: 768px) {
  :root { --nav-h: auto; }

  header .container {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 20px;
    gap: 10px;
    height: auto;
  }

  nav { flex-wrap: wrap; gap: 2px; }
  /* Hide text labels in main nav links on mobile */
  nav > a { font-size: 0.82rem; padding: 8px 12px; min-height: 44px; display: flex; align-items: center; }
  nav > a span { display: none; }
  nav > a svg { width: 20px; height: 20px; }
  .nav-user-menu { margin-left: 0; }
  .nav-user-btn { 
    min-height: 44px; 
    padding: 8px 12px;
  }
  /* Hide email text on mobile, show only icons */
  .nav-user-btn span {
    display: none;
  }
  .nav-user-dropdown { 
    right: auto; 
    left: 0; 
    min-width: 200px;
  }
  /* Keep text visible in dropdown menu items */
  .nav-dropdown-item span {
    display: inline !important;
  }

  .dashboard-welcome { padding: 28px 24px; }
  .dashboard-welcome::after { display: none; }
  .dashboard-welcome h2 { font-size: 1.35rem; }
  .dashboard-grid { grid-template-columns: 1fr; }

  main { padding: 24px 0 48px; }
  .card { padding: 20px; }

  .btn { min-height: 44px; padding: 10px 20px; }
  .btn-sm { min-height: 38px; padding: 8px 16px; }

  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { text-align: center; justify-content: center; }

  /* Tee time items - make them stack vertically */
  .tee-time-item { 
    flex-direction: column; 
    align-items: stretch; 
    gap: 12px; 
    padding: 16px;
  }
  .tee-time-main {
    width: 100%;
  }
  .tee-time-meta { 
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between !important;
  }
  .tee-time-actions { width: 100%; }
  .tee-time-actions .btn { width: 100%; }
  
  /* Make Book button full width on mobile */
  .tt-book-btn {
    width: 100% !important;
    justify-content: center;
  }
  
  .tee-times-form-grid { grid-template-columns: 1fr; gap: 0; }

  .book-layout { grid-template-columns: 1fr; }
  .players-layout { grid-template-columns: 1fr; }
  .groups-grid { grid-template-columns: 1fr; }
  .group-selector { grid-template-columns: 1fr; }
  .add-player-fields { grid-template-columns: 1fr; }
  .new-group-inner { flex-direction: column; align-items: stretch; }
  .book-datetime { flex-direction: column; gap: 16px; }

  .weather-banner { flex-wrap: wrap; padding: 10px 20px; gap: 8px; font-size: 0.85rem; }
  .weather-tod-group { display: flex; flex-wrap: wrap; gap: 8px; }
  
  /* Schedule table - make it scrollable */
  .card { overflow-x: auto; }
  
  /* Players table - stack action buttons */
  .player-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .player-actions .btn {
    width: 100%;
  }
  
  /* Edit actions - stack on mobile */
  .edit-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .edit-actions .btn {
    width: 100%;
  }
  
  /* Add group form - stack on mobile */
  .add-group-form {
    flex-direction: column;
    align-items: stretch;
  }
  .add-group-form input[type="text"],
  .add-group-input {
    width: 100% !important;
  }
  
  /* Date tabs - make more compact and scrollable on mobile */
  .date-tab-bar {
    padding: 12px 12px 12px 16px; /* Extra padding on left to show first tab fully */
    gap: 6px;
    /* Enable smooth scrolling */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    /* Add scroll snap for better UX */
    scroll-snap-type: x proximity;
  }
  
  .date-tab {
    min-width: 80px;
    padding: 10px 14px;
    flex-shrink: 0; /* Prevent tabs from shrinking */
    scroll-snap-align: start;
  }
  
  .date-tab-day {
    font-size: 0.7rem;
  }
  
  .date-tab-date {
    font-size: 0.88rem;
  }
  
  .date-tab-badge {
    min-width: 20px;
    height: 20px;
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  
  header .container { padding: 12px 16px; }
  
  .brand { font-size: 1.1rem; }
  
  nav a { font-size: 0.78rem; padding: 8px 10px; }
  
  .weather-banner-sep { display: none; }
  .weather-tod-item { font-size: 0.8rem; }
  
  .card { padding: 16px; }
  
  .dashboard-welcome h2 { font-size: 1.2rem; }
  .dashboard-welcome p { font-size: 0.88rem; }
  
  .loading-card { padding: 32px 24px; min-width: 240px; }
}

/* ── Mobile Optimizations ─────────────────────────────────────── */
@media (max-width: 640px) {
  /* Hide button text on mobile, show only icon */
  .btn-text-desktop {
    display: none;
  }
  
  /* Make alert banner more compact on mobile */
  .alert-cached {
    padding: 10px 14px;
    gap: 8px;
  }
  
  .alert-content strong {
    font-size: 0.9rem;
  }
  
  /* Keep refresh button inline but more compact */
  .alert-action .btn {
    padding: 6px 10px;
    min-height: 36px;
  }
}
