/* ============================================================
   Double Tee Tournaments — base stylesheet
   No Tailwind, no build step. Plain CSS served from public/.
   Dynamic per-club branding via CSS custom properties that the
   Blade layout overrides in a <style>:root{…}</style> block.
   ============================================================ */

:root {
  /* Brand tokens — overridden at runtime from the resolved branding_profile */
  --brand-primary: #166534;
  --brand-secondary: #14532d;
  --brand-accent: #16a34a;
  --brand-on-primary: #ffffff;

  /* Neutral palette (golfspot contract) */
  --text: #404040;
  --muted: #6b7280;
  --border: #e5e7eb;
  --surface: #ffffff;
  --bg: #f7f8fa;

  /* Dropdown chevron for filter selects */
  --icon-dropdown: url(/img/dropdown_arrow.svg);
  --icon-dropdown-w: 14px;
  --icon-dropdown-h: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Roboto', Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 25px;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
}

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

h1 { font-size: 1.6rem; font-weight: 600; margin: 0; }
h2 { font-size: 1.2rem; font-weight: 600; margin: 0 0 .75rem; }
h3 { font-size: 1rem; font-weight: 600; margin: 0 0 .5rem; }

/* ── Admin shell: sidebar + content ───────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 292px;
  flex: 0 0 292px;
  background: #0d2525;
  border-right: 1px solid #173333;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  z-index: 1400;
  height: 100vh;
  overflow: visible;
  transition: width .18s ease, flex-basis .18s ease;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .95rem 1.35rem .75rem;
  min-height: 72px;
}
.sidebar-brand img { object-fit: contain; }
.sidebar-logo-long { display: block; max-height: 44px; max-width: 190px; }
.sidebar-logo-mark { display: none; max-height: 38px; max-width: 36px; }
.sidebar-brand .brand-name { font-weight: 700; font-size: 1.15rem; color: #faf7f2; }

.sidebar nav {
  flex: 1;
  min-height: 0;
  padding: 1rem .75rem;
}

.nav-group { padding: .5rem 0; }
.nav-group-label {
  padding: .5rem 1.1rem .25rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(250, 247, 242, .56);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 44px;
  padding: .55rem 1.1rem;
  color: rgba(250, 247, 242, .86);
  font-size: .95rem;
  border-left: 3px solid transparent;
  border-radius: 8px;
  transition: background .14s ease, color .14s ease, padding .18s ease;
}
.nav-item:hover { background: rgba(250, 247, 242, .07); color: #fff; text-decoration: none; }
.nav-item.active {
  background: #174227;
  border-left-color: #bf976e;
  color: #fff;
  font-weight: 500;
}

.nav-main {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.nav-flyout-wrap {
  position: relative;
}
.nav-parent {
  position: relative;
  border-left: 0;
}
.nav-item-icon,
.nav-flyout-icon,
.topbar-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.nav-item-icon {
  width: 22px;
  height: 22px;
  color: rgba(250, 247, 242, .7);
}
.nav-item-icon svg,
.nav-flyout-icon svg,
.topbar-pill-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-parent.active .nav-item-icon,
.nav-parent:hover .nav-item-icon {
  color: #faf7f2;
}
.nav-item-label {
  flex: 1;
  min-width: 0;
}
.nav-chevron {
  margin-left: auto;
  color: rgba(250, 247, 242, .58);
  font-size: 1.25rem;
  line-height: 1;
}
.nav-flyout {
  position: absolute;
  top: -8px;
  left: calc(100% + 12px);
  z-index: 2600;
  width: 260px;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .14);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-6px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}
.nav-flyout-wrap:hover .nav-flyout,
.nav-flyout-wrap:focus-within .nav-flyout {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}
.nav-flyout-title {
  padding: .25rem .4rem .55rem;
  color: var(--text);
  font-size: .95rem;
  font-weight: 700;
}
.nav-flyout-list,
.nav-flyout-actions {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.nav-flyout-actions {
  margin-top: .65rem;
  padding-top: .65rem;
  border-top: 1px solid var(--border);
}
.nav-flyout-kicker {
  padding: .1rem .4rem .35rem;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.nav-flyout-link {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 36px;
  padding: .45rem .5rem;
  border-radius: 6px;
  color: var(--text);
  font-size: .9rem;
}
.nav-flyout-link:hover,
.nav-flyout-link.active {
  background: color-mix(in srgb, var(--brand-primary) 8%, #fff);
  color: var(--brand-primary);
  text-decoration: none;
}
.nav-flyout-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.nav-flyout-link:hover .nav-flyout-icon,
.nav-flyout-link.active .nav-flyout-icon {
  color: var(--brand-primary);
}
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 .35rem;
  border-radius: 999px;
  background: var(--brand-primary);
  color: var(--brand-on-primary);
  font-size: .72rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: .75rem;
}
.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  min-height: 44px;
  padding: .55rem 1.1rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(250, 247, 242, .86);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
}
.sidebar-toggle:hover {
  background: rgba(250, 247, 242, .07);
  color: #fff;
}
.sidebar-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: rgba(250, 247, 242, .76);
  transition: transform .18s ease, color .14s ease;
}
.sidebar-toggle:hover .sidebar-toggle-icon {
  color: #faf7f2;
}
.sidebar-toggle-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-is-collapsed .sidebar.sidebar-collapsible {
  width: 84px;
  flex-basis: 84px;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-brand {
  justify-content: center;
  padding: .85rem .75rem;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-logo-long,
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-brand .brand-name {
  display: none;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-logo-mark {
  display: block;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible nav {
  padding: 1rem .55rem;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-main {
  gap: .35rem;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-item {
  justify-content: center;
  gap: 0;
  min-height: 48px;
  padding: .65rem;
  border-left-color: transparent;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-item.active {
  border-left-color: transparent;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-item-label,
.sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-chevron {
  display: none;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-item-icon {
  width: 24px;
  height: 24px;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-item-icon svg {
  width: 19px;
  height: 19px;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-flyout {
  left: calc(100% + 10px);
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-footer {
  padding: .75rem .55rem;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-toggle {
  justify-content: center;
  gap: 0;
  padding: .65rem;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-toggle-label {
  display: none;
}
.sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-toggle-icon {
  transform: rotate(180deg);
}

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── Top bar ──────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  min-height: 64px;
  position: sticky;
  top: 0;
  z-index: 1200;
}
.topbar .topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar .topbar-right { display: flex; align-items: center; gap: .75rem; }
.topbar.topbar-has-search {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(320px, 520px) minmax(260px, 1fr);
}
.topbar.topbar-has-search .topbar-left { justify-self: start; }
.topbar.topbar-has-search .topbar-search { justify-self: stretch; }
.topbar.topbar-has-search .topbar-right { justify-self: end; }
.topbar-actions {
  min-width: 0;
  flex-wrap: wrap;
  gap: .5rem;
}
.topbar-menu-wrap,
.profile-menu {
  position: relative;
}
.topbar-pill,
.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}
.topbar-pill {
  padding: 0 .45rem;
  border-radius: 8px;
}
.topbar-pill:hover,
.topbar-menu-wrap.is-open .topbar-pill {
  background: #f8fafc;
}
.topbar-pill-icon {
  width: 22px;
  height: 22px;
  color: var(--text);
}
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 .35rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
}
.count-badge-green {
  background: color-mix(in srgb, var(--brand-primary) 14%, #fff);
  color: var(--brand-primary);
}
.count-badge-gold {
  background: #fff7ed;
  color: #b45309;
}
.topbar-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 2700;
  width: 340px;
  padding: .65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .16);
}
.topbar-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .25rem .35rem .6rem;
  font-size: .9rem;
}
.topbar-menu-head a {
  font-size: .78rem;
  font-weight: 700;
}
.topbar-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .55rem .6rem;
  border-radius: 6px;
  color: var(--text);
}
.topbar-menu-row:hover {
  background: #f8fafc;
  text-decoration: none;
}
.topbar-menu-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar-menu-title,
.topbar-menu-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-menu-title {
  font-weight: 700;
  line-height: 1.3;
}
.topbar-menu-sub,
.topbar-menu-time {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.35;
}
.topbar-menu-time {
  flex: 0 0 auto;
}
.topbar-menu-empty {
  padding: .75rem .6rem;
  color: var(--muted);
  font-size: .9rem;
}
.profile-trigger {
  padding: .15rem .25rem .15rem .15rem;
  border-radius: 10px;
}
.profile-trigger:hover,
.profile-menu.is-open .profile-trigger {
  background: #f8fafc;
}
.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 12%, #fff);
  color: var(--brand-primary);
  font-size: .82rem;
  font-weight: 800;
}
.profile-avatar-lg {
  width: 44px;
  height: 44px;
}
.profile-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.profile-name,
.profile-role {
  max-width: 180px;
  overflow: hidden;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-name {
  font-size: .9rem;
  font-weight: 800;
}
.profile-role {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 600;
}
.profile-chevron {
  color: var(--muted);
  font-size: 1rem;
}
.profile-dropdown {
  right: 0;
  left: auto;
  width: 280px;
}
.profile-card {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .45rem .45rem .7rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .35rem;
}
.profile-card span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.profile-card strong,
.profile-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-card small {
  color: var(--muted);
  font-size: .78rem;
}
.profile-link {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  padding: .45rem .55rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  text-align: left;
  cursor: pointer;
}
.profile-link:hover {
  background: #f8fafc;
  text-decoration: none;
}
.profile-logout {
  color: #b91c1c;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.global-search {
  position: relative;
  width: 100%;
}
.global-search input[type=search] {
  width: 100%;
  height: 42px;
  padding: 0 1rem 0 2.35rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background:
    linear-gradient(45deg, transparent 45%, var(--muted) 45%, var(--muted) 55%, transparent 55%) 15px 20px / 8px 8px no-repeat,
    radial-gradient(circle at center, transparent 42%, var(--muted) 44%, var(--muted) 57%, transparent 59%) 12px 12px / 14px 14px no-repeat,
    #fff;
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  outline: none;
}
.global-search input[type=search]:focus {
  border-color: color-mix(in srgb, var(--brand-primary) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 12%, transparent);
}
.global-search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 2500;
  max-height: min(520px, calc(100vh - 96px));
  overflow-y: auto;
  padding: .45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .16);
}
.global-search-status {
  padding: .55rem .65rem;
  color: var(--muted);
  font-size: .86rem;
}
.global-search-group + .global-search-group { margin-top: .35rem; }
.global-search-group-label {
  padding: .45rem .55rem .25rem;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.global-search-result {
  display: block;
  padding: .55rem .65rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}
.global-search-result:hover,
.global-search-result.active {
  background: color-mix(in srgb, var(--brand-primary) 9%, #fff);
  color: var(--text);
  text-decoration: none;
}
.global-search-result-title {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.global-search-result-description {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .topbar.topbar-has-search {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "left right"
      "search search";
  }
  .topbar.topbar-has-search .topbar-left { grid-area: left; }
  .topbar.topbar-has-search .topbar-search { grid-area: search; }
  .topbar.topbar-has-search .topbar-right { grid-area: right; }
}
@media (max-width: 720px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    position: relative;
    width: 100%;
    flex-basis: auto;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible {
    width: 100%;
    flex-basis: auto;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-brand {
    justify-content: flex-start;
    padding: .95rem 1.35rem .75rem;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-logo-long {
    display: block;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .sidebar-logo-mark {
    display: none;
  }
  .sidebar nav {
    display: flex;
    overflow-x: auto;
    padding: .75rem;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible nav {
    padding: .75rem;
  }
  .nav-main {
    flex-direction: row;
    min-width: max-content;
  }
  .nav-parent {
    min-width: 150px;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-item {
    justify-content: flex-start;
    gap: .6rem;
    min-height: 44px;
    padding: .55rem 1.1rem;
  }
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-item-label,
  .sidebar-is-collapsed .sidebar.sidebar-collapsible .nav-chevron {
    display: inline-flex;
  }
  .nav-flyout {
    display: none;
  }
  .sidebar-footer {
    display: none;
  }
  .topbar {
    padding: .75rem 1rem;
  }
  .topbar .topbar-right .profile-copy {
    display: none;
  }
  .topbar-menu {
    position: fixed;
    left: 1rem;
    right: 1rem;
    top: 132px;
    width: auto;
  }
  .profile-dropdown {
    left: 1rem;
    right: 1rem;
  }
}

.content-body { padding: 1.5rem; max-width: 1280px; width: 100%; }

/* ── Product switcher ─────────────────────────────────────── */
.product-switcher { position: relative; }
.product-switcher select {
  appearance: none;
  -webkit-appearance: none;
  height: 38px;
  padding: 0 calc(14px + var(--icon-dropdown-w) + 8px) 0 .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff var(--icon-dropdown) no-repeat right 12px center;
  background-size: var(--icon-dropdown-w) var(--icon-dropdown-h);
  font-family: inherit;
  font-size: .9rem;
  color: var(--text);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  height: 40px;
  padding: 0 1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--brand-primary); color: var(--brand-on-primary); }
.btn-primary:hover { background: var(--brand-secondary); text-decoration: none; color: var(--brand-on-primary); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: #fafafa; text-decoration: none; }
.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-sm { height: 32px; padding: 0 .7rem; font-size: .85rem; }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.org-count {
  display: inline-block;
  margin-left: .4rem;
  padding: 0 .5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 12%, #fff);
  color: var(--brand-primary);
  font-size: .9rem;
  font-weight: 600;
  vertical-align: middle;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

/* ── Filters (golfspot-filters contract) ──────────────────── */
.filters {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.filters input,
.filters select {
  height: 44px;
  padding: 0 .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 400;
  color: var(--text);
}
.filters select {
  appearance: none;
  -webkit-appearance: none;
  background: #fff var(--icon-dropdown) no-repeat right 14px center;
  background-size: var(--icon-dropdown-w) var(--icon-dropdown-h);
  padding-right: calc(14px + var(--icon-dropdown-w) + 4px);
}
.filters label { font-weight: 400; color: var(--text); }

.active-filters { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 9999px;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}
.active-filter-chip:hover { background: #e0e7ff; text-decoration: none; }
.active-filter-chip span[aria-hidden] { font-size: 14px; line-height: 1; }

/* ── Tables (golfspot-tables contract) ────────────────────── */
.table-container {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.table-container table {
  width: 100%;
  min-width: 800px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-family: inherit;
}
.table-container th,
.table-container td {
  height: 60px;
  padding: 1rem;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text);
}
.table-container thead th {
  background: #fff;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid var(--border);
}
.table-container tbody tr:last-child td { border-bottom: 0; }
.table-container tbody tr:hover td { background: #fafafa; }
.table-container tbody tr.clickable,
.table-container tbody tr.has-actions { position: relative; cursor: pointer; }

.table-container td.actions-cell,
.table-container th.actions-cell {
  position: sticky;
  right: 0;
  z-index: 2;
  background: inherit;
}
.table-container th.actions-cell { z-index: 3; }

.table-container .row-actions {
  position: absolute;
  top: 4px;
  bottom: 0;
  right: 1rem;
  display: flex;
  gap: .4rem;
  align-items: center;
  padding: .2rem 1rem;
  border-radius: 4px;
  background: rgba(245, 245, 245, .8);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
  z-index: 1500;
}
.table-container tbody tr:hover .row-actions { opacity: 1; visibility: visible; }
.table-container .row-actions button,
.table-container .row-actions a {
  height: 44px;
  padding: .4rem .8rem;
  border: 0;
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 100%;
  cursor: pointer;
}
.table-empty { color: var(--muted); text-align: center; }

/* ── Chips (golfspot-tables palette) ──────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.chip-status-draft, .chip-priority-laag                         { background: #f3f4f6; color: #374151; }
.chip-status-published, .chip-status-afgerond,
.chip-status-released, .chip-visibility-public,
.chip-status-gepubliceerd, .chip-status-active                  { background: #dcfce7; color: #166534; }
.chip-type-bug, .chip-priority-hoog, .chip-status-archived,
.chip-status-archief, .chip-status-failed                       { background: #fee2e2; color: #b91c1c; }
.chip-type-improvement, .chip-priority-medium,
.chip-status-in_progress, .chip-status-gesloten,
.chip-status-provisioning                                       { background: #fef3c7; color: #92400e; }
.chip-type-request, .chip-status-ingepland,
.chip-visibility-anonymized, .chip-status-concept               { background: #dbeafe; color: #1e40af; }
.chip-product                                                   { background: #eef2ff; color: #4338ca; }
.chip-list { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ── Forms ────────────────────────────────────────────────── */
.form-grid { display: grid; gap: 1rem; max-width: 640px; }
.form-row { display: flex; flex-direction: column; gap: .35rem; }
.form-row label { font-size: .9rem; font-weight: 500; color: var(--text); }
.form-row input[type=text],
.form-row input[type=email],
.form-row input[type=password],
.form-row input[type=number],
.form-row input[type=date],
.form-row input[type=time],
.form-row input[type=color],
.form-row select,
.form-row textarea {
  height: 44px;
  padding: 0 .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: .95rem;
  color: var(--text);
  background: #fff;
}
.form-row textarea { height: auto; padding: .6rem .75rem; min-height: 96px; }
.form-error { color: #b91c1c; font-size: .85rem; }
.form-actions { display: flex; gap: .5rem; margin-top: .5rem; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #b91c1c; }

/* ── Dashboard widgets (six equal blocks) ─────────────────── */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 1024px) { .widget-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .widget-grid { grid-template-columns: 1fr; } }
.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}
.widget h3 { margin-bottom: .75rem; }
.widget .widget-foot { margin-top: auto; }
.widget .widget-foot a { font-size: .9rem; }

/* Stacked date block: WOE / 29 / MEI */
.date-block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  padding: .35rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  line-height: 1.1;
}
.date-block .dow { font-size: .65rem; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.date-block .day { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.date-block .mon { font-size: .65rem; font-weight: 600; text-transform: uppercase; color: var(--brand-primary); }

.list-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: 0; }
.list-row .list-row-main { flex: 1; min-width: 0; }
.list-row .list-row-title { font-weight: 500; }
.list-row .list-row-sub { font-size: .85rem; color: var(--muted); }

/* ── Tournament workflow ──────────────────────────────────── */
.workflow-card {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #f8faf9 100%);
}
.workflow-head,
.workflow-next,
.workflow-step,
.flow-action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.workflow-head h2,
.flow-action-head h2 { margin: .15rem 0 .25rem; }
.workflow-head p,
.workflow-next p,
.workflow-step p,
.flow-action-head p {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
}
.workflow-head strong {
  font-size: 1.8rem;
  color: var(--brand-primary);
}
.workflow-eyebrow,
.workflow-next span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}
.workflow-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}
.workflow-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-primary), #d2a971);
}
.workflow-next {
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 20%, var(--border));
  border-radius: 8px;
  background: #f5fbf7;
}
.workflow-next strong {
  display: block;
  margin: .15rem 0;
}
.workflow-next form,
.workflow-step-action form { margin: 0; }
.workflow-next-complete {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.workflow-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.workflow-step {
  min-height: 112px;
  align-items: flex-start;
  padding: .9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.workflow-step.is-open {
  border-color: #fde68a;
  background: #fffbeb;
}
.workflow-step-marker {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #eef2f0;
  color: var(--brand-primary);
  font-weight: 700;
}
.workflow-step.is-done .workflow-step-marker {
  background: #dcfce7;
  color: #166534;
}
.workflow-step-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .35rem;
}
.workflow-step > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.workflow-step-action {
  flex: 0 0 auto;
  align-self: center;
}
.workflow-action-done {
  color: var(--muted);
  font-size: .85rem;
}
.flow-action-card {
  scroll-margin-top: 96px;
}
.pairing-form {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}
.pairing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 1rem;
}
.form-help {
  align-self: center;
  color: var(--muted);
  font-size: .9rem;
}
.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.spec-card {
  margin-bottom: 1.5rem;
}
.spec-grid .spec-card {
  margin-bottom: 0;
}
.spec-card h2 {
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .workflow-steps,
  .pairing-grid,
  .spec-grid {
    grid-template-columns: 1fr;
  }
  .workflow-head,
  .workflow-next,
  .workflow-step,
  .flow-action-head {
    align-items: flex-start;
  }
  .workflow-next,
  .workflow-step {
    flex-direction: column;
  }
  .workflow-step-action {
    align-self: stretch;
  }
  .workflow-step-action .btn,
  .workflow-step-action form,
  .workflow-step-action button,
  .workflow-next .btn,
  .workflow-next form,
  .workflow-next button {
    width: 100%;
  }
}

/* ── Branded auth / login ─────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.55)),
    var(--auth-bg, linear-gradient(135deg, var(--brand-secondary), var(--brand-primary)));
  background-size: cover;
  background-position: center;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.auth-card .auth-logo { text-align: center; margin-bottom: 1rem; }
.auth-card .auth-logo img { max-height: 64px; max-width: 200px; object-fit: contain; }
.auth-card h1 { font-size: 1.25rem; text-align: center; margin-bottom: .25rem; }
.auth-card .auth-club { text-align: center; color: var(--muted); margin-bottom: 1.5rem; font-size: .9rem; }
.auth-card .btn { width: 100%; }
.auth-divider {
  display: flex; align-items: center; gap: .75rem;
  color: var(--muted); font-size: .8rem; margin: 1rem 0;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-foot { text-align: center; margin-top: 1.5rem; font-size: .75rem; color: var(--muted); }
