/* ── Omnio warm design system adapted for Golf Crew ───────────────────── */
:root {
  --bg:          #FAF6F1;
  --surface:     #F5EEE6;
  --surface-2:   #EDE5DB;
  --border:      #E0D5CC;
  --border-lt:   #CFC3B5;
  --text:        #2A1510;
  --text-2:      #5C3D35;
  --text-3:      #7A5C55;
  --accent:      #C96A45;
  --accent-hover:#B05A38;
  --accent-dim:  rgba(201,106,69,0.12);
  --green:       #16A34A;
  --green-dim:   rgba(22,163,74,0.12);
  --red:         #DC2626;
  --red-dim:     rgba(220,38,38,0.1);
  --amber:       #D97706;
  --amber-dim:   rgba(217,119,6,0.12);
  --radius:      8px;
  --radius-lg:   12px;
  --font-head:   'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:   'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

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

/* ── Nav (always dark like omnioai.io) ────────────────────────────────── */
.nav {
  background: #2A1510;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-icon { font-size: 1.25rem; }
.brand-text {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  color: #F5EEE6;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
}
.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(245,238,230,0.65);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: #F5EEE6; background: rgba(255,255,255,0.08); }
.nav-link.active { color: #F5EEE6; background: rgba(255,255,255,0.1); }
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}
.nav-user {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(245,238,230,0.65);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-user:hover { color: #F5EEE6; }
.nav-logout {
  font-size: 0.8rem;
  color: rgba(245,238,230,0.4);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-logout:hover { color: #FCA5A5; }

/* ── Main layout ──────────────────────────────────────────────────────── */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Flash messages ───────────────────────────────────────────────────── */
.flash-container {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.flash-success { background: rgba(22,163,74,0.08);  border-color: rgba(22,163,74,0.35);  color: #166534; }
.flash-error   { background: rgba(220,38,38,0.07);  border-color: rgba(220,38,38,0.35);  color: #991B1B; }
.flash-warning { background: rgba(217,119,6,0.08);  border-color: rgba(217,119,6,0.35);  color: #92400E; }
.flash-info    { background: rgba(37,99,235,0.07);  border-color: rgba(37,99,235,0.35);  color: #1E40AF; }

/* ── Typography ───────────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: 2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.4rem; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.95rem; }
p  { color: var(--text-2); }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}
.page-subtitle { font-size: 0.9rem; color: var(--text-3); margin-top: 4px; }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.card-sm { padding: 1rem 1.25rem; }
.card + .card { margin-top: 1rem; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-title {
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ── Grid layouts ─────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 0.875rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-lt); background: var(--surface-2); }
.btn-success   { background: var(--green); color: #fff; }
.btn-success:hover { opacity: 0.88; }
.btn-danger    { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: 0.88; }
.btn-ghost     { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-lt); background: var(--surface-2); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-xs { padding: 4px 10px; font-size: 0.75rem; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 9px 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,106,69,0.12);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-3); }
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 0.78rem; color: var(--text-3); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ── Time slot presets ────────────────────────────────────────────────── */
.slot-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.slot-preset {
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
}
.slot-preset:hover { border-color: var(--accent); color: var(--accent); }
.slot-preset.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.slot-preset:hover { transform: none; }

/* ── Badges ───────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-green  { background: rgba(22,163,74,0.12);   color: #166534; }
.badge-red    { background: rgba(220,38,38,0.1);    color: #991B1B; }
.badge-amber  { background: rgba(217,119,6,0.12);   color: #92400E; }
.badge-blue   { background: rgba(37,99,235,0.1);    color: #1E40AF; }
.badge-gray   { background: var(--surface-2);       color: var(--text-3); border: 1px solid var(--border); }

/* ── Table ────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
td {
  font-size: 0.875rem;
  color: var(--text-2);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

/* ── Availability heat map ────────────────────────────────────────────── */
.heat-grid { overflow-x: auto; }
.heat-table { border-collapse: separate; border-spacing: 3px; }
.heat-table th {
  font-size: 0.72rem;
  color: var(--text-3);
  text-align: center;
  padding: 6px 8px;
  border: none;
  letter-spacing: 0.08em;
}
.heat-cell {
  width: 56px;
  height: 48px;
  border-radius: 6px;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  border: 1px solid transparent;
  position: relative;
  transition: transform 0.1s, box-shadow 0.1s;
}
.heat-cell:hover { transform: scale(1.07); z-index: 2; box-shadow: 0 2px 8px rgba(42,21,16,0.15); }
.heat-cell .cell-count { font-size: 1rem; font-weight: 700; }
.heat-cell .cell-date  { font-size: 0.62rem; color: var(--text-3); }

/* Heat intensity — green scale for light background */
.heat-0 { background: var(--surface-2); border-color: var(--border); color: var(--text-3); }
.heat-1 { background: rgba(22,163,74,0.14); border-color: rgba(22,163,74,0.2); }
.heat-2 { background: rgba(22,163,74,0.28); border-color: rgba(22,163,74,0.35); }
.heat-3 { background: rgba(22,163,74,0.48); border-color: rgba(22,163,74,0.55); color: #fff; }
.heat-4 { background: rgba(22,163,74,0.70); border-color: rgba(22,163,74,0.75); color: #fff; }
.heat-5 { background: rgba(22,163,74,0.90); border-color: rgba(22,163,74,0.95); color: #fff; }

.heat-weekend-header { color: var(--accent) !important; }

.week-summary-cell {
  width: 148px;
  min-width: 148px;
  padding: 4px 6px;
  vertical-align: top;
}
.week-label {
  font-size: 0.65rem;
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}
.week-round-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.67rem;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
  border-radius: 4px;
  padding: 2px 5px;
  margin-bottom: 2px;
  border: 1px solid var(--border);
  transition: background 0.1s;
}
.week-round-row:hover { background: var(--surface-3, var(--border)); }
.week-round-day { color: var(--accent); font-weight: 700; flex-shrink: 0; }
.week-round-course { flex: 1; color: var(--text-2); overflow: hidden; white-space: nowrap; }
.week-round-spots { font-weight: 600; color: #16a34a; flex-shrink: 0; }
.week-round-spots.full { color: var(--text-3); }
.week-round-players {
  font-size: 0.6rem;
  color: var(--text-3);
  padding: 0 5px 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 138px;
}

/* ── Course cards ─────────────────────────────────────────────────────── */
.course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s, background 0.15s;
}
.course-card:hover { border-color: var(--border-lt); background: #fff; }
.course-name {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.course-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.course-meta-item {
  font-size: 0.78rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}
.course-notes {
  font-size: 0.82rem;
  color: var(--text-2);
  font-style: italic;
  line-height: 1.5;
}
.course-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Course map ───────────────────────────────────────────────────────── */
#course-map {
  height: 580px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.view-toggle {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 3px;
  border: 1px solid var(--border);
}
.view-toggle-btn {
  padding: 5px 16px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--text-3);
  transition: all 0.15s;
}
.view-toggle-btn.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(42,21,16,0.12);
}

/* ── Round / Trip list items ──────────────────────────────────────────── */
.event-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.event-item:hover { border-color: var(--border-lt); background: #fff; }
.event-date-block {
  flex-shrink: 0;
  width: 52px;
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 4px;
}
.event-date-month { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.event-date-day   { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1; }
.event-info { flex: 1; }
.event-title { font-family: var(--font-head); font-size: 1rem; font-weight: 700; color: var(--text); }
.event-sub   { font-size: 0.82rem; color: var(--text-3); margin-top: 2px; }
.event-right { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

/* ── Dashboard stat cards ─────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (max-width: 800px) { .stat-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .stat-grid { grid-template-columns: 1fr; } }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.stat-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); margin-bottom: 8px; }
.stat-value { font-family: var(--font-head); font-size: 2.2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-sub   { font-size: 0.78rem; color: var(--text-3); margin-top: 6px; }

/* ── Empty state ──────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-3);
}
.empty-icon  { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.6; }
.empty-title { font-family: var(--font-head); font-size: 1rem; color: var(--text-2); margin-bottom: 0.5rem; }
.empty-sub   { font-size: 0.85rem; }

/* ── Auth pages ───────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(42,21,16,0.08);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2rem;
  justify-content: center;
}
.auth-brand-icon { font-size: 2rem; }
.auth-brand-text {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}
.auth-subtitle { font-size: 0.875rem; color: var(--text-3); text-align: center; margin-bottom: 1.75rem; margin-top: -1.5rem; }

/* ── Tooltip on heat cells ────────────────────────────────────────────── */
.tooltip-wrap { position: relative; display: inline-block; width: 100%; height: 100%; }
.tooltip-content {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #2A1510;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.78rem;
  color: #F5EEE6;
  white-space: nowrap;
  z-index: 999;
  min-width: 150px;
  text-align: left;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(42,21,16,0.2);
}
.tooltip-wrap:hover .tooltip-content { display: block; }
.tooltip-date { font-weight: 700; color: #FAF6F1; margin-bottom: 4px; font-size: 0.82rem; }
.tooltip-member { font-size: 0.75rem; color: rgba(245,238,230,0.65); }
.tooltip-link { display: block; margin-top: 6px; font-size: 0.75rem; color: var(--accent); font-weight: 600; }

/* ── Divider ──────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── Section heading ──────────────────────────────────────────────────── */
.section-heading {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1rem;
}

/* ── Inline utils ─────────────────────────────────────────────────────── */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; }
.gap-sm       { gap: 0.5rem; }
.gap-md       { gap: 1rem; }
.gap-lg       { gap: 1.5rem; }
.mt-sm        { margin-top: 0.5rem; }
.mt-md        { margin-top: 1rem; }
.mt-lg        { margin-top: 1.5rem; }
.mb-md        { margin-bottom: 1rem; }
.mb-lg        { margin-bottom: 1.5rem; }
.text-sm      { font-size: 0.82rem; }
.text-xs      { font-size: 0.75rem; }
.text-muted   { color: var(--text-3); }
.text-right   { text-align: right; }
.w-full       { width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
