/* ═══════════════════════════════════════════════════════════════════
   LAYER 0 — Fonts
   ═══════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════════════════════════
   LAYER 1 — Design Tokens
   ═══════════════════════════════════════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg:              #f0f2f5;
  --bg-gradient:     radial-gradient(ellipse at top left, #eff6ff 0%, #f0f2f5 60%),
                     radial-gradient(ellipse at bottom right, #ecfeff 0%, #f0f2f5);
  /* Surfaces */
  --surface:         #ffffff;
  --surface-hover:   #f8fafc;
  --surface-border:  #e2e8f0;
  --surface-glass:   rgba(255,255,255,0.85);
  /* Text */
  --text:            #0f172a;
  --text-muted:      #64748b;
  --text-subtle:     #94a3b8;
  /* Accent — Teal */
  --teal:            #0d9488;
  --teal-light:      #14b8a6;
  --teal-glow:       rgba(13,148,136,0.12);
  --teal-glow-lg:    rgba(13,148,136,0.22);
  /* Accent — Blue */
  --blue:            #2563eb;
  --blue-glow:       rgba(37,99,235,0.12);
  /* Accent — Amber */
  --amber:           #d97706;
  --amber-bg:        #fef3c7;
  --amber-text:      #92400e;
  /* Status */
  --good-bg:         #dcfce7;
  --good-text:       #166534;
  --warn-bg:         #fef3c7;
  --warn-text:       #92400e;
  --danger-bg:       #fee2e2;
  --danger-text:     #991b1b;
  --info-bg:         #dbeafe;
  --info-text:       #1e40af;
  /* Shadows */
  --shadow-sm:       0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:          0 4px 16px -2px rgba(0,0,0,0.06), 0 2px 8px -2px rgba(0,0,0,0.04);
  --shadow-lg:       0 20px 40px -8px rgba(0,0,0,0.10), 0 8px 20px -6px rgba(0,0,0,0.06);
  /* Radii */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;
  /* Bracket tokens */
  --bracket-gap: 40px;
  /* Transitions */
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
  /* Sidebar width */
  --sidebar-w:       280px;
  --sidebar-w-mini:  72px;
}

[data-theme="dark"] {
  --bg:              #090d16;
  --bg-gradient:     radial-gradient(ellipse at 10% 20%, rgba(13,148,136,0.08) 0%, transparent 40%),
                     radial-gradient(ellipse at 90% 80%, rgba(37,99,235,0.08) 0%, transparent 40%),
                     #090d16;
  --surface:         #111827;
  --surface-hover:   #1f2937;
  --surface-border:  #374151;
  --surface-glass:   rgba(17,24,39,0.75);
  --text:            #f9fafb;
  --text-muted:      #9ca3af;
  --text-subtle:     #6b7280;
  --teal:            #2dd4bf;
  --teal-light:      #5eead4;
  --teal-glow:       rgba(45,212,191,0.20);
  --teal-glow-lg:    rgba(45,212,191,0.35);
  --blue:            #60a5fa;
  --blue-glow:       rgba(96,165,250,0.20);
  --good-bg:         rgba(16,185,129,0.15);
  --good-text:       #34d399;
  --warn-bg:         rgba(245,158,11,0.15);
  --warn-text:       #fbbf24;
  --danger-bg:       rgba(239,68,68,0.15);
  --danger-text:     #f87171;
  --info-bg:         rgba(96,165,250,0.15);
  --info-text:       #60a5fa;
  --shadow-sm:       0 1px 3px rgba(0,0,0,0.30);
  --shadow:          0 4px 16px -2px rgba(0,0,0,0.40);
  --shadow-lg:       0 20px 40px -8px rgba(0,0,0,0.55);
}

/* ═══════════════════════════════════════════════════════════════════
   LAYER 2 — Base / Reset
   ═══════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  transition: background-color var(--transition),
              border-color var(--transition),
              color var(--transition),
              box-shadow var(--transition);
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg-gradient);
  color: var(--text);
  scroll-behavior: smooth;
  overflow-x: hidden;
}

h1,h2,h3,h4,h5,h6 { margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* Global scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }

/* ═══════════════════════════════════════════════════════════════════
   LAYER 3 — Shell Layout
   ═══════════════════════════════════════════════════════════════════ */

/* App shell: sidebar | main */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns var(--transition);
}

.app-shell.collapsed {
  grid-template-columns: var(--sidebar-w-mini) 1fr;
}

/* ── Sidebar ── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--surface-border);
  padding: 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: visible;
  z-index: 100;
  transition: padding var(--transition);
}

.app-shell.collapsed .sidebar { padding: 20px 12px; }

/* Collapse toggle button */
.sidebar-toggle {
  position: absolute;
  right: -13px;
  top: 32px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  box-shadow: var(--shadow-sm);
  z-index: 110;
  transition: transform var(--transition), border-color var(--transition), color var(--transition);
}
.sidebar-toggle:hover { border-color: var(--teal); color: var(--teal); }
.app-shell.collapsed .sidebar-toggle { transform: rotate(180deg); }

/* Tooltip when collapsed */
.app-shell.collapsed .nav-item { position: relative; }
.app-shell.collapsed .nav-item::after {
  content: attr(data-title);
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: var(--surface);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  z-index: 1000;
}
.app-shell.collapsed .nav-item:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ── Brand ── */
.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  overflow: hidden;
}
.app-shell.collapsed .brand-section { justify-content: center; }

.brand-logo {
  width: 35px;
  height: 35px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 16px var(--teal-glow-lg);
  flex-shrink: 0;
}

.brand-text { overflow: hidden; transition: opacity var(--transition), max-width var(--transition); }
.brand-text h2 {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}
.brand-text span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  font-weight: 600;
}
.app-shell.collapsed .brand-text { opacity: 0; max-width: 0; pointer-events: none; }

/* ── Nav ── */
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-subtle);
  padding: 4px 16px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}
.app-shell.collapsed .nav-section-label { opacity: 0; }

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: none;
}
.nav-menu::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: background var(--transition), color var(--transition), padding var(--transition), gap var(--transition);
}
.app-shell.collapsed .nav-item { justify-content: center; padding: 10px; gap: 0; }

.nav-item .icon-only { font-size: 18px; flex-shrink: 0; }

.nav-text { transition: opacity var(--transition); }
.app-shell.collapsed .nav-text { opacity: 0; max-width: 0; overflow: hidden; pointer-events: none; display: none; }

.nav-item:hover { color: var(--text); background: var(--surface-hover); }
.nav-item.active {
  background: var(--teal-glow);
  color: var(--teal);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--teal);
}

/* ── Theme toggle (sidebar bottom) ── */
.theme-toggle-section {
  margin-top: auto;
  padding: 14px;
  background: var(--surface-hover);
  border-radius: var(--r-md);
  border: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  overflow: hidden;
  transition: padding var(--transition);
}
.app-shell.collapsed .theme-toggle-section { padding: 12px 8px; justify-content: center; }

.theme-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: opacity var(--transition);
}
.app-shell.collapsed .theme-label { opacity: 0; max-width: 0; overflow: hidden; display: none; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 44px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: var(--surface-border);
  border-radius: 22px;
  cursor: pointer;
  transition: background var(--transition);
}
.slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}
input:checked + .slider { background: var(--teal); }
input:checked + .slider::before { transform: translateX(22px); }

/* ── Main content ── */
.main-content {
  padding: 20px 32px;
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Mobile navbar (hidden on desktop) ── */
.mobile-navbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--surface-border);
  padding: 0 20px;
  align-items: center;
  justify-content: space-between;
  z-index: 200;
  box-shadow: var(--shadow);
}

.mobile-brand { display: flex; align-items: center; gap: 10px; }
.brand-logo-small {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: white;
  font-weight: 800;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.brand-text-small h3 { margin: 0; font-size: 15px; font-weight: 700; font-family: 'Outfit', sans-serif; }
.brand-text-small span { font-size: 9px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }

.mobile-hamburger {
  background: transparent;
  border: 0;
  display: flex; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 8px;
}
.mobile-hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--transition); }

/* ── Mobile drawer ── */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--surface-border);
  z-index: 199;
  padding: 12px 16px 20px;
  box-shadow: var(--shadow-lg);
}
.mobile-drawer.open { display: block; animation: slideDown 0.25s ease; }
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

.mobile-nav-menu { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.mobile-nav-item {
  display: block;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}
.mobile-nav-item:hover, .mobile-nav-item.active { background: var(--teal-glow); color: var(--teal); }

.mobile-theme-toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--surface-hover);
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-border);
}
.mobile-theme-label { font-size: 13px; font-weight: 600; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════
   LAYER 4 — Components
   ═══════════════════════════════════════════════════════════════════ */

/* ── Page Chrome ── */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--teal);
  font-weight: 700;
  margin-bottom: 4px;
}

.header-title h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-title p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--teal); }
.breadcrumb-sep { color: var(--text-subtle); }

.category-badge-group {
  display: flex;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  padding: 5px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.cat-btn {
  border: 0;
  background: transparent;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.cat-btn.active, .cat-btn:hover { background: var(--teal); color: white; }

/* ── Tab Containers ── */
.tab-container { display: none; }
.tab-container.active { display: block; animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ── Section Wrapper ── */
.section-wrapper {
  background: var(--surface-glass);
  /* backdrop-filter removed — creates stacking context that clips dropdowns */
  border: 1px solid var(--surface-border);
  border-radius: var(--r-xl);
  padding: 28px 32px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  overflow: visible;
}

/* Flush variant: no side padding, useful for wide brackets */
.section-wrapper--flush {
  padding-left: 0;
  padding-right: 0;
}
.section-wrapper--flush .section-header { padding-left: 32px; padding-right: 32px; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--surface-border);
  gap: 12px;
  flex-wrap: wrap;
}
.section-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
}
.section-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Sub-title (inside section) */
.section-sub-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--teal);
  border-left: 3px solid var(--teal);
  padding-left: 10px;
  margin-bottom: 16px;
}

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.search-input::before {
  content: '🔍';
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.5;
  pointer-events: none;
}
.search-input input { padding-left: 38px; }

/* ── Form inputs ── */
.input, .select, .textarea,
input.form-control, select.form-control, textarea.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus, .select:focus, .textarea:focus,
input.form-control:focus, select.form-control:focus, textarea.form-control:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}
.textarea, textarea.form-control { resize: vertical; min-height: 90px; }

.select-filter {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  min-width: 160px;
  cursor: pointer;
}
.select-filter:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-glow); }

/* Form layout helpers */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.form-row { display: grid; gap: 16px; margin-bottom: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Club/Organization Dropdown (autocomplete) ── */
.club-dropdown {
    position: absolute;
    z-index: 1000;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--r-sm);
    max-height: 250px;
    overflow-y: auto;
    width: 100%;
    box-shadow: var(--shadow-lg);
}
.club-dropdown .club-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--surface-border);
}
.club-dropdown .club-item:hover {
    background: var(--surface-hover);
}
.club-dropdown .club-item:last-child {
    border-bottom: none;
}
.club-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}
.club-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.form-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--surface-border);
}
.form-section-title:first-child { margin-top: 0; }

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}
.checkbox-field input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--teal); cursor: pointer; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--teal); color: white; border-color: var(--teal); }
.btn-primary:hover { background: var(--teal-light); box-shadow: 0 4px 12px var(--teal-glow-lg); }

.btn-secondary { background: var(--surface-hover); color: var(--text); border-color: var(--surface-border); }
.btn-secondary:hover { border-color: var(--teal); color: var(--teal); }

.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }

.btn-danger { background: var(--danger-bg); color: var(--danger-text); border-color: transparent; }
.btn-danger:hover { opacity: 0.85; }

.btn-blue { background: var(--blue); color: white; border-color: var(--blue); }
.btn-blue:hover { opacity: 0.9; box-shadow: 0 4px 12px var(--blue-glow); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.good    { background: var(--good-bg);   color: var(--good-text); }
.badge.warn    { background: var(--warn-bg);   color: var(--warn-text); }
.badge.danger  { background: var(--danger-bg); color: var(--danger-text); }
.badge.info    { background: var(--info-bg);   color: var(--info-text); }
.badge.teal    { background: var(--teal-glow-lg); color: var(--teal); }

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  margin-top: 24px;
}
.page-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.page-btn:hover { border-color: var(--teal); color: var(--teal); }
.page-btn.active { background: var(--teal); color: white; border-color: var(--teal); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 14px; }

/* ── Data Table ── */
.table-responsive { width: 100%; overflow-x: auto; }

.premium-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
.premium-table th {
  padding: 12px 16px;
  background: var(--surface-hover);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--surface-border);
  white-space: nowrap;
}
.premium-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 24px;
}
.premium-table th.sortable::after {
  content: ' ↕';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.3;
  transition: opacity var(--transition);
}
.premium-table th.sortable:hover::after {
  opacity: 0.8;
}
.premium-table th.sortable.sort-asc::after {
  content: ' ↑';
  opacity: 1;
  color: var(--teal);
}
.premium-table th.sortable.sort-desc::after {
  content: ' ↓';
  opacity: 1;
  color: var(--teal);
}
.premium-table th.sortable:hover { color: var(--teal); }
.premium-table td { padding: 14px 16px; border-bottom: 1px solid var(--surface-border); vertical-align: middle; }
.premium-table tbody tr:hover { background: var(--surface-hover); }
.premium-table tbody tr:last-child td { border-bottom: 0; }

/* ── Player Cell (avatar + name + subtitle) ── */
.player-cell { display: flex; align-items: center; gap: 11px; }

.player-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.player-avatar-lg {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 16px var(--blue-glow);
}

.player-name { font-weight: 600; font-size: 14px; }
.player-club { font-size: 12px; color: var(--text-muted); }

/* ── Streak badge ── */
.streak-badge { display: inline-flex; gap: 3px; }
.streak-char {
  width: 20px; height: 20px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  font-weight: 700;
}
.streak-char.win  { background: var(--good-bg);   color: var(--good-text); }
.streak-char.loss { background: var(--danger-bg); color: var(--danger-text); }

/* ── KPI Dashboard Grid ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--teal); }
.kpi-card--accent { background: linear-gradient(135deg, var(--surface), var(--teal-glow)); }

.kpi-info h3 { font-size: 12px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; margin-bottom: 4px; }
.kpi-info strong { font-size: 26px; font-family: 'Outfit', sans-serif; font-weight: 700; display: block; }
.kpi-info span { font-size: 11px; color: var(--good-text); font-weight: 600; }

.kpi-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--surface-hover);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

/* ── Tournament Wizard ── */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
  padding-bottom: 8px;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 80px;
  position: relative;
  cursor: pointer;
}
.wizard-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 35%;
  width: 100%;
  height: 2px;
  background: var(--surface-border);
  z-index: 0;
}
.wizard-step.done:not(:last-child)::after,
.wizard-step.active:not(:last-child)::after { background: var(--teal); }

.wizard-step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  z-index: 1;
  transition: background var(--transition), color var(--transition);
}
.wizard-step.active .wizard-step-num { background: var(--teal); color: white; box-shadow: 0 0 0 4px var(--teal-glow); }
.wizard-step.done .wizard-step-num { background: var(--teal); color: white; }

.wizard-step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}
.wizard-step.active .wizard-step-label { color: var(--teal); }
.wizard-step.done .wizard-step-label { color: var(--good-text); }

.wizard-step.locked {
  pointer-events: none;
  cursor: default;
  opacity: 0.45;
}
.wizard-step.locked .wizard-step-label { color: var(--text-subtle); }
a.wizard-step {
  text-decoration: none;
  color: inherit;
}

.wizard-body { min-height: 300px; }

.wizard-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--surface-border);
}

/* ── Bracket / Draw ── */
.bracket-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 240px));
  gap: var(--bracket-gap);
  position: relative;
  padding: 20px 32px 20px;
  --bracket-gap: 40px;
  overflow-x: auto;
  justify-content: safe center;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--teal) var(--surface-hover);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.bracket-flow-8 {
  display: grid;
  grid-template-columns: repeat(4, minmax(200px, 240px));
  gap: var(--bracket-gap);
  position: relative;
  padding: 20px 32px 20px;
  --bracket-gap: 30px;
  overflow-x: auto;
  justify-content: safe center;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--teal) var(--surface-hover);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.bracket-flow::-webkit-scrollbar,
.bracket-flow-8::-webkit-scrollbar { height: 5px; }
.bracket-flow::-webkit-scrollbar-track,
.bracket-flow-8::-webkit-scrollbar-track { background: var(--surface-hover); border-radius: 3px; }
.bracket-flow::-webkit-scrollbar-thumb,
.bracket-flow-8::-webkit-scrollbar-thumb { background: var(--teal); border-radius: 3px; }

.bracket-round {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

.bracket-round-title {
  text-align: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 28px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bracket-round-matches {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex-grow: 1;
  gap: 20px;
  position: relative;
}

/* Match pair wrapper */
.match-pair {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  justify-content: center;
}

/* U-shape right connector */
.bracket-round:not(:last-child) .match-pair::after {
  content: '';
  position: absolute;
  right: calc(var(--bracket-gap) / -2);
  top: 48px;
  bottom: 48px;
  width: calc(var(--bracket-gap) / 2);
  border-top: 2px solid var(--surface-border);
  border-bottom: 2px solid var(--surface-border);
  border-right: 2px solid var(--surface-border);
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  z-index: 1;
  pointer-events: none;
  transition: border-color var(--transition);
}

/* Horizontal line from connector to next card */
.bracket-round:not(:last-child) .match-pair::before {
  content: '';
  position: absolute;
  right: calc(var(--bracket-gap) * -1);
  top: 50%;
  width: calc(var(--bracket-gap) / 2);
  height: 2px;
  background: var(--surface-border);
  z-index: 1;
  transform: translateY(-50%);
  transition: background var(--transition);
}

.bracket-round:not(:last-child) .match-pair:hover::after { border-color: var(--teal); }
.bracket-round:not(:last-child) .match-pair:hover::before { background: var(--teal); box-shadow: 0 0 6px var(--teal-glow); }

/* Spread: for semifinal vertically centering to QF pairs */
.match-pair--spread, .match-pair.spread {
  height: 100%;
  justify-content: space-around;
  gap: 0;
}
.bracket-round:not(:last-child) .match-pair--spread::after,
.bracket-round:not(:last-child) .match-pair.spread::after { top: 100px; bottom: 100px; }

/* Single card advancement (final) */
.match-card.single-advance::after {
  content: '';
  position: absolute;
  right: calc(var(--bracket-gap) * -1);
  top: 50%;
  width: var(--bracket-gap);
  height: 2px;
  background: var(--surface-border);
  z-index: 1;
  transform: translateY(-50%);
  transition: background var(--transition);
}
.match-card.single-advance:hover::after { background: var(--teal); }

/* Match cards */
.match-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.match-card:hover { border-color: var(--teal); box-shadow: 0 0 12px var(--teal-glow-lg); transform: translateY(-1px); }

.match-header {
  padding: 7px 12px;
  background: var(--surface-hover);
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}
.edit-hint {
  margin-left: 5px;
  opacity: 0.45;
  font-size: 10px;
  transition: opacity var(--transition), transform var(--transition);
  display: inline-block;
}
.match-card:hover .edit-hint {
  opacity: 1;
  transform: scale(1.2) rotate(15deg);
}

.match-teams { padding: 0; }

.match-team-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--surface-border);
  min-height: 39px;
}
.match-team-row .player-name-val {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
  display: inline-block;
  vertical-align: middle;
}
.match-team-row:last-child { border-bottom: 0; }
.match-team-row.winner { font-weight: 700; background: var(--teal-glow); }
.match-team-row.winner span:first-child { color: var(--teal); }

.match-score {
  background: var(--surface-hover);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.match-team-row.winner .match-score { background: var(--teal); color: white; }

/* Winner / loser team row backgrounds */
.match-team-row.winner {
  background: rgba(22, 163, 74, 0.08);
  border-left: 3px solid #16a34a;
  font-weight: 600;
}
.match-team-row.winner .player-name-val {
  color: #16a34a;
}
.match-team-row.loser {
  background: rgba(220, 38, 38, 0.04);
  border-left: 3px solid rgba(220, 38, 38, 0.3);
}

/* Bracket: Winner box */
.winner-box {
  background: linear-gradient(135deg, var(--teal-glow-lg), var(--blue-glow));
  border: 2px solid var(--teal);
  border-radius: var(--r-lg);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: center;
  min-width: 160px;
}
.winner-badge { font-family: 'Outfit', sans-serif; font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--teal); letter-spacing: 1px; }
.winner-name { font-size: 15px; font-weight: 700; }

/* Monrad bracket title */
.monrad-bracket-title { font-size: 14px; font-weight: 700; color: var(--teal); border-left: 3px solid var(--teal); padding-left: 10px; margin-bottom: 18px; margin-left: 32px; }

/* Consolations layout */
.monrad-consolations {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 32px;
  margin-top: 24px;
  padding: 0 32px;
}
.monrad-consolations > div {
  min-width: 0;
}
.consolation-stack { display: flex; flex-direction: column; gap: 28px; }
.consolation-title { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }

/* ── Round Robin / Pools ── */
.pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.pool-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.pool-card-header {
  padding: 14px 18px;
  background: var(--surface-hover);
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pool-name { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 700; }
.pool-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pool-table th { padding: 8px 12px; font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--surface-border); }
.pool-table td { padding: 10px 12px; border-bottom: 1px solid var(--surface-border); }
.pool-table tbody tr:last-child td { border-bottom: 0; }
.pool-table tbody tr:hover { background: var(--surface-hover); }
.pool-table td.diagonal { background: var(--surface-border); text-align: center; }

/* ── Ranking ── */
.ranking-podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
.podium-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-lg);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.podium-card--gold   { border-color: #f59e0b; background: linear-gradient(135deg, var(--surface), rgba(245,158,11,0.06)); }
.podium-card--silver { border-color: #94a3b8; background: linear-gradient(135deg, var(--surface), rgba(148,163,184,0.06)); }
.podium-card--bronze { border-color: #b45309; background: linear-gradient(135deg, var(--surface), rgba(180,83,9,0.06)); }

.podium-medal { font-size: 32px; }
.podium-rank { font-family: 'Outfit', sans-serif; font-size: 28px; font-weight: 800; }
.podium-card--gold   .podium-rank { color: #f59e0b; }
.podium-card--silver .podium-rank { color: #94a3b8; }
.podium-card--bronze .podium-rank { color: #b45309; }
.podium-name { font-size: 15px; font-weight: 700; }
.podium-club { font-size: 12px; color: var(--text-muted); }
.podium-rating { font-size: 20px; font-weight: 700; font-family: 'Outfit', sans-serif; }

.trend-up   { color: var(--good-text); font-size: 12px; font-weight: 700; }
.trend-down { color: var(--danger-text); font-size: 12px; font-weight: 700; }
.trend-flat { color: var(--text-muted); font-size: 12px; font-weight: 700; }

/* ── Organization / Club Cards ── */
.org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.org-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}
.org-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--teal); }
.org-card-top { display: flex; align-items: center; gap: 14px; }
.org-logo {
  width: 50px; height: 50px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.org-name { font-weight: 700; font-size: 15px; }
.org-type { font-size: 12px; color: var(--text-muted); }
.org-meta { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-muted); }
.org-meta-item { display: flex; align-items: center; gap: 6px; }
.org-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  border-top: 1px solid var(--surface-border);
  padding-top: 12px;
}
.org-stat-box { text-align: center; }
.org-stat-box span { font-size: 11px; color: var(--text-muted); display: block; }
.org-stat-box strong { font-size: 16px; font-weight: 700; }

/* ── Player Profile ── */
.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.profile-info { flex: 1; min-width: 200px; }
.profile-name-block h2 { font-family: 'Outfit', sans-serif; font-size: 26px; font-weight: 700; }
.profile-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); margin-top: 8px; }

.stat-badges { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.stat-badge { text-align: center; padding: 10px 18px; background: var(--surface-hover); border-radius: var(--r-sm); border: 1px solid var(--surface-border); }
.stat-value { display: block; font-size: 22px; font-weight: 700; font-family: 'Outfit', sans-serif; color: var(--teal); }
.stat-label { display: block; font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }

.profile-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-hover);
  padding: 5px;
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.profile-tab {
  flex: 1;
  min-width: 80px;
  text-align: center;
  padding: 8px 14px;
  color: var(--text-muted);
  border-radius: calc(var(--r-sm) - 3px);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.profile-tab:hover { color: var(--text); }
.profile-tab.active { background: var(--surface); color: var(--teal); box-shadow: var(--shadow-sm); font-weight: 600; }

/* ── Scoreboard / Referee ── */
.live-ref-panel {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

.ref-court-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ref-court-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--surface-hover);
  border-bottom: 1px solid var(--surface-border);
}
.serve-indicator {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--surface-border);
  display: inline-block;
  transition: background var(--transition), box-shadow var(--transition);
}
.serve-indicator.active { background: var(--teal); box-shadow: 0 0 8px var(--teal-glow-lg); }

.ref-players-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--surface-border);
}
.ref-player-side {
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.ref-player-side:first-child { border-right: 1px solid var(--surface-border); }
.ref-player-side h3 { font-size: 16px; font-weight: 700; margin: 0; }
.ref-score-big {
  font-family: 'Outfit', sans-serif;
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  color: var(--teal);
  cursor: pointer;
  transition: transform 0.1s, color 0.2s;
  user-select: none;
}
.ref-score-big:hover { color: var(--teal-light); transform: scale(1.05); }

.ref-set-scores {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.ref-set-scores span {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface-hover);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
}
.ref-set-scores span.active { background: var(--teal-glow); border-color: var(--teal); color: var(--teal); font-weight: 600; }

.ref-settings-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-xl);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ref-settings-card h3 { font-size: 15px; font-weight: 700; }

.action-btn-group { display: flex; flex-direction: column; gap: 8px; }

.btn-score-control {
  padding: 8px 14px;
  border: 1px solid var(--surface-border);
  background: var(--surface-hover);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition);
}
.btn-score-control:hover { border-color: var(--teal); color: var(--teal); }

.btn-custom {
  padding: 9px 14px;
  border: 1px solid var(--surface-border);
  background: var(--surface-hover);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  transition: border-color var(--transition), background var(--transition);
}
.btn-custom:hover { border-color: var(--teal); background: var(--teal-glow); }
.btn-custom.primary { background: var(--teal); color: white; border-color: var(--teal); }
.btn-custom.primary:hover { opacity: 0.9; }
.btn-custom.danger { background: var(--danger-bg); color: var(--danger-text); border-color: transparent; }

.court-badge {
  background: var(--teal);
  color: white;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Ref sets progress bar */
.sets-progress-bar {
  height: 6px;
  background: var(--surface-border);
  border-radius: 99px;
  overflow: hidden;
  display: flex;
}
.sets-progress-p1 { height: 100%; background: var(--teal); transition: width var(--transition); }
.sets-progress-p2 { height: 100%; background: var(--blue); transition: width var(--transition); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  width: 100%;
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { opacity:0; transform:translateY(20px) scale(0.97); } to { opacity:1; transform:translateY(0) scale(1); } }

.modal--sm  { max-width: 420px; }
.modal--md  { max-width: 600px; }
.modal--lg  { max-width: 860px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--surface-border);
}
.modal-header h3 { font-family: 'Outfit', sans-serif; font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 0;
  background: var(--surface-hover);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger-text); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--surface-border);
}

/* ── Alert / Info boxes inside modal ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-danger { background: var(--danger-bg); color: var(--danger-text); border: 1px solid rgba(153,27,27,0.2); }
.alert-success { background: var(--good-bg); color: var(--good-text); }
.d-none { display: none; }

/* ── Toast message (form-message-toast) ── */
.form-message-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: var(--r-xl);
  font-size: 14px;
  font-weight: 500;
  color: white;
  background: var(--danger-text);
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}
.form-message-toast.success {
  background: var(--good-text);
}

/* ── Dashboard activity feed ── */
.activity-feed { display: flex; flex-direction: column; gap: 12px; }
.activity-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface-hover);
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-border);
  font-size: 13px;
}
.activity-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.activity-dot.good    { background: var(--good-text); }
.activity-dot.warn    { background: var(--amber); }
.activity-dot.info    { background: var(--blue); }
.activity-time { color: var(--text-subtle); font-size: 12px; margin-left: auto; white-space: nowrap; }

/* ── Calendar Card Grid ── */
.calendar-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.calendar-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-lg);
  padding: 0;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}
.calendar-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--teal);
}
.calendar-card-image {
  display: block;
  overflow: hidden;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  aspect-ratio: 16 / 9;
  background: var(--bg);
}
.calendar-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.calendar-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 22px 22px;
}
.calendar-card-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.calendar-card-head .calendar-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}
.calendar-card-head .calendar-card-org {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
.calendar-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.calendar-card-meta p {
  margin: 0;
}
.calendar-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.calendar-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}
.calendar-card-org {
  font-size: 12px;
  color: var(--text-muted);
}
.calendar-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.calendar-card-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.calendar-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  border-top: 1px solid var(--surface-border);
  padding-top: 14px;
}
.calendar-card-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--teal);
}

/* ── Wizard Modal Steps ── */
.wizard-modal-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 12px;
}
.wizard-modal-step {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
  padding: 6px;
  cursor: pointer;
}
.wizard-modal-step.active {
  color: var(--teal);
  font-weight: 700;
  border-bottom: 2px solid var(--teal);
}
.wizard-modal-step.done {
  color: var(--good-text);
}
/* Player list inside wizard modal */
.wizard-player-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--surface-border);
  border-radius: var(--r-sm);
  margin-top: 12px;
  background: var(--surface);
}
.wizard-player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--surface-border);
}
.wizard-player-row:last-child {
  border-bottom: 0;
}
.wizard-player-row:hover {
  background: var(--surface-hover);
}
.wizard-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

/* ── Drag & Drop CSV Import Zone ── */
.csv-upload-zone {
  border: 2px dashed var(--surface-border);
  border-radius: var(--r-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-hover);
  transition: border-color var(--transition), background var(--transition);
}
.csv-upload-zone:hover, .csv-upload-zone.dragover {
  border-color: var(--teal);
  background: var(--teal-glow);
}
.csv-upload-icon {
  font-size: 40px;
  margin-bottom: 12px;
}
.csv-upload-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}
.csv-upload-text {
  font-size: 12px;
  color: var(--text-muted);
}

/* Required field asterisk */
.required-asterisk {
  color: var(--danger-text);
  font-weight: 700;
  margin-left: 2px;
  font-size: 1em;
  vertical-align: baseline;
}

/* ── Misc helpers ── */
.text-muted { color: var(--text-muted); }
.text-teal  { color: var(--teal); }
.fw-700     { font-weight: 700; }
.mt-0       { margin-top: 0; }

/* ═══════════════════════════════════════════════════════════════════
   LAYER 5 — Responsive
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1280px: Tablet landscape — auto-collapse sidebar ── */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .main-content { padding: 24px 24px; }
  .ranking-podium { grid-template-columns: 1fr 1fr 1fr; }
}

/* ── 980px: Tablet portrait / Mobile ── */
@media (max-width: 980px) {
  .app-shell, .app-shell.collapsed { grid-template-columns: 1fr !important; margin-top: 64px; }
  .sidebar { display: none !important; }
  .mobile-navbar { display: flex; }
  .main-content { padding: 20px 16px; }
  .section-wrapper { padding: 20px 16px; border-radius: var(--r-lg); }
  .section-wrapper--flush .section-header { padding-left: 16px; padding-right: 16px; }
  .monrad-bracket-title { margin-left: 16px; }
  .bracket-flow, .bracket-flow-8 { padding: 16px 0; justify-content: flex-start; }
  .monrad-consolations {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 0 16px;
  }
  .header-bar { flex-direction: column; align-items: flex-start; gap: 14px; }
  .category-badge-group { flex-wrap: wrap; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .live-ref-panel { grid-template-columns: 1fr; }
  .ranking-podium { grid-template-columns: 1fr; gap: 10px; }
  .form-row-3, .form-row-4 { grid-template-columns: 1fr 1fr; }
  .org-grid { grid-template-columns: 1fr; }
}

/* ── 768px: Large phone ── */
@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { padding: 16px; }
  .kpi-info strong { font-size: 22px; }
  .form-row-2 { grid-template-columns: 1fr; }
  .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
  .pool-grid { grid-template-columns: 1fr; }
  .bracket-flow { grid-template-columns: repeat(3, 180px) !important; gap: 24px; --bracket-gap: 24px; }
  .bracket-flow-8 { grid-template-columns: repeat(4, 180px) !important; gap: 20px; --bracket-gap: 20px; }
  .wizard-steps { gap: 0; }
  .wizard-step-label { display: none; }
  .modal { border-radius: var(--r-lg); }
}

/* ── 600px: Small phone ── */
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .header-title h1 { font-size: 22px; }
  .section-header h2 { font-size: 17px; }
  .ref-players-grid { grid-template-columns: 1fr; }
  .ref-player-side:first-child { border-right: 0; border-bottom: 1px solid var(--surface-border); }
  .ref-score-big { font-size: 52px; }
  .category-badge-group { display: none; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { border-bottom-left-radius: 0; border-bottom-right-radius: 0; max-height: 85vh; }
}

/* ═══════════════════════════════════════════════════════════════════
   LAYER 6 — Utilities & Custom Component Modifiers
   ═══════════════════════════════════════════════════════════════════ */

/* --- Spacing Utilities --- */
.u-mt-0 { margin-top: 0 !important; }
.u-mt-xs { margin-top: 8px !important; }
.u-mt-sm { margin-top: 12px !important; }
.u-mt-md { margin-top: 20px !important; }
.u-mt-lg { margin-top: 24px !important; }
.u-mt-xl { margin-top: 32px !important; }
.u-mt-neg-xs { margin-top: -8px !important; }

.u-mb-0 { margin-bottom: 0 !important; }
.u-mb-xs { margin-bottom: 8px !important; }
.u-mb-sm { margin-bottom: 12px !important; }
.u-mb-md { margin-bottom: 16px !important; }
.u-mb-lg { margin-bottom: 24px !important; }

.u-mr-xs { margin-right: 6px !important; }
.u-ml-xs { margin-left: 8px !important; }

/* --- Flex Gap Utilities --- */
.g-10 { gap: 10px !important; }
.g-16 { gap: 16px !important; }

/* --- Play Dates Selection --- */
.dates-wrapper {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  gap: 0.5rem;
}
.dates-wrapper .play-dates {
  border: 2px solid var(--surface-border);
  background-color: var(--surface);
  color: var(--text);
  text-align: center;
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  min-height: 80px;
  width: 72px;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.dates-wrapper .play-dates:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-sm);
}
.dates-wrapper .play-dates.selected {
  border-color: var(--teal);
  background-color: var(--teal-glow);
  color: var(--teal);
  box-shadow: 0 0 0 2px var(--teal-glow);
}
.dates-wrapper .play-dates .day-of-week-data {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dates-wrapper .play-dates .day-data {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  line-height: 1;
  color: var(--text);
}
.dates-wrapper .play-dates .month-data {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: lowercase;
}
.dates-wrapper .play-dates.selected .day-of-week-data,
.dates-wrapper .play-dates.selected .day-data,
.dates-wrapper .play-dates.selected .month-data {
  color: var(--teal);
}

/* --- Table Date Chips (Созданные категории / Даты игр) --- */
.table-dates-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.table-date-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 38px;
  padding: 4px 6px;
  border: 1px solid var(--surface-border);
  background-color: var(--surface);
  color: var(--text);
  border-radius: var(--r-sm);
  line-height: 1.1;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.table-date-chip:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-sm);
}
.table-date-chip.selected {
  border-color: var(--teal);
  background-color: var(--teal-glow);
  color: var(--teal);
  box-shadow: 0 0 0 2px var(--teal-glow);
}
.table-date-chip .tdc-weekday {
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: lowercase;
}
.table-date-chip .tdc-day {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--text);
}
.table-date-chip .tdc-month {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: lowercase;
}
.table-date-chip.selected .tdc-weekday,
.table-date-chip.selected .tdc-day,
.table-date-chip.selected .tdc-month {
  color: var(--teal);
}

/* --- Flex Layout Utilities --- */
.u-flex-end { justify-content: flex-end !important; }
.u-flex-direction-column { flex-direction: column !important; }
.justify-between { justify-content: space-between !important; }
.align-center { align-items: center !important; }

/* --- Padding Utilities --- */
.u-p-0 { padding: 0 !important; }
.u-p-md { padding: 16px !important; }
.u-p-lg { padding: 24px !important; }

/* --- Text Utilities --- */
.u-text-base { font-size: 14px !important; }
.u-text-xl { font-size: 20px !important; }
.u-teal-text { color: var(--teal) !important; }

/* --- Font Utilities --- */
.u-font-normal { font-weight: 400 !important; }
.u-font-italic { font-style: italic !important; }

/* --- Margin Utilities --- */
.u-m-0 { margin: 0 !important; }

/* --- Size & Typo Helpers --- */
.u-w-full { width: 100% !important; }
.u-text-center { text-align: center !important; }
.u-font-sm { font-size: 11px !important; }
.u-font-md { font-size: 13px !important; }
.u-font-lg { font-size: 14px !important; }
.u-font-bold { font-weight: 700 !important; }
.u-d-block { display: block !important; }
.u-flex-1 { flex: 1 !important; }

/* --- Flexbox & Alignment Helpers --- */
.u-flex { display: flex !important; }
.u-flex-col { display: flex; flex-direction: column; }
.u-flex-gap-xs { display: flex; gap: 4px; }
.u-flex-gap-sm { display: flex; gap: 6px; }
.u-flex-gap-md { display: flex; gap: 12px; }
.u-flex-gap-lg { display: flex; gap: 24px; }
.u-flex-center { display: flex; justify-content: center; align-items: center; }
.u-flex-between { display: flex; justify-content: space-between; }
.u-flex-align-center { display: flex; align-items: center; }
.u-flex-row-center { display: flex; justify-content: center; }

/* --- Custom Component Modifiers --- */
.search-input--wide {
  flex: 1.5;
  min-width: 250px;
}

.org-logo--card {
  width: 40px;
  height: 40px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.org-logo--large {
  width: 52px;
  height: 52px;
  font-size: 18px;
}

.player-avatar--small {
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.player-avatar--large {
  width: 52px;
  height: 52px;
  font-size: 18px;
}

.checkbox-field--card {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px;
  background: var(--surface-hover);
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-border);
  cursor: pointer;
}
.checkbox-field--card.active {
  border-color: var(--teal);
  border-width: 2px;
}
.checkbox-field--panel {
  padding: 16px;
  background: var(--surface-hover);
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-border);
  width: 100%;
}

.winner-box--custom {
  min-width: 120px;
  padding: 14px 12px;
}

.sets-progress-custom {
  background: var(--surface-hover);
  padding: 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-border);
}

.gm-wizard-body {
  min-height: 380px;
}

.bracket-flow--consolation {
  --bracket-gap: 24px;
  grid-template-columns: repeat(3, minmax(160px, 200px));
}

.modal-wizard-card-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-game-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.modal-score-input {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  width: 80px;
  margin: 0 auto;
}

.u-font-xxl {
  font-size: 28px !important;
}

.u-mr-sm {
  margin-right: 10px !important;
}




/* ═══════════════════════════════════════════════════════════════════
   LAYER 6 — Synthesized DLE Admin & Helper Overrides
   ═══════════════════════════════════════════════════════════════════ */

.u-mb-xs { margin-bottom: 8px !important; }
.u-mb-sm { margin-bottom: 12px !important; }
.u-mb-md { margin-bottom: 16px !important; }
.u-mb-lg { margin-bottom: 24px !important; }

.u-mr-xs { margin-right: 6px !important; }
.u-ml-xs { margin-left: 8px !important; }

/* --- Size & Typo Helpers --- */
.u-w-full { width: 100% !important; }
.u-text-center { text-align: center !important; }
.u-font-sm { font-size: 11px !important; }
.u-font-md { font-size: 13px !important; }
.u-font-lg { font-size: 14px !important; }
.u-font-bold { font-weight: 700 !important; }
.u-d-block { display: block !important; }
.u-flex-1 { flex: 1 !important; }

/* --- Flexbox & Alignment Helpers --- */
.u-flex { display: flex !important; }
.u-flex-col { display: flex; flex-direction: column; }
.u-flex-gap-xs { display: flex; gap: 4px; }
.u-flex-gap-sm { display: flex; gap: 6px; }
.u-flex-gap-md { display: flex; gap: 12px; }
.u-flex-gap-lg { display: flex; gap: 24px; }
.u-flex-center { display: flex; justify-content: center; align-items: center; }
.u-flex-between { display: flex; justify-content: space-between; }
.u-flex-align-center { display: flex; align-items: center; }
.u-flex-row-center { display: flex; justify-content: center; }

/* --- Custom Component Modifiers --- */
.search-input--wide {
  flex: 1.5;
  min-width: 250px;
}

.org-logo--card {
  width: 40px;
  height: 40px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.org-logo--large {
  width: 52px;
  height: 52px;
  font-size: 18px;
}

.player-avatar--small {
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.player-avatar--large {
  width: 52px;
  height: 52px;
  font-size: 18px;
}

.checkbox-field--card {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px;
  background: var(--surface-hover);
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-border);
  cursor: pointer;
}
.checkbox-field--card.active {
  border-color: var(--teal);
  border-width: 2px;
}
.checkbox-field--panel {
  padding: 16px;
  background: var(--surface-hover);
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-border);
  width: 100%;
}

.winner-box--custom {
  min-width: 120px;
  padding: 14px 12px;
}

.sets-progress-custom {
  background: var(--surface-hover);
  padding: 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-border);
}

.gm-wizard-body {
  min-height: 380px;
}

.bracket-flow--consolation {
  --bracket-gap: 24px;
  grid-template-columns: repeat(3, minmax(160px, 200px));
}

.modal-wizard-card-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-game-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.modal-score-input {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  width: 80px;
  margin: 0 auto;
}

.u-font-xxl {
  font-size: 28px !important;
}

.u-mr-sm {
  margin-right: 10px !important;
}

.delete-item-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: #f5c6cb;
    color: #721c24;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #f1b0b7;
}
.alert {
    border-radius: 2rem;
    font-size: 12px;
    text-align: center;
}
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}
#tournamentModal .alert-heading, #quickTournamentModal .alert-heading {
    color: inherit;
    margin-top: 0;
    margin-bottom: 0.5rem;
}
h5 {
    font-size: 18px;
}

/* ── User Avatar in Header ── */
a.user-avatar-section {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  border-radius: 50%;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

a.user-avatar-section:hover {
  opacity: 0.85;
  box-shadow: 0 0 0 3px var(--blue);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--surface-border);
  display: block;
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
  .wizard-steps {
    gap: 4px;
    flex-wrap: wrap;
  }
  
  .wizard-step {
    flex: 0 1 calc(25% - 4px);
    min-width: 60px;
    max-width: 80px;
  }
  
  .wizard-step-label {
    font-size: 10px;
  }
  
  .modal {
    max-width: 95vw;
    max-height: 95vh;
    border-radius: var(--r-lg);
  }
  
  .modal-overlay {
    padding: 12px;
  }
}

/* ── Admin Part — голубая шапка для админки ── */
body.rin-admin-part .sidebar,
body.rin-admin-part .mobile-navbar {
  background: #009fdd;
}
body.rin-admin-part .sidebar .brand-logo {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
body.rin-admin-part .sidebar .brand-text,
body.rin-admin-part .sidebar .brand-text h2,
body.rin-admin-part .sidebar .brand-text span,
body.rin-admin-part .sidebar .nav-item,
body.rin-admin-part .sidebar .nav-item .nav-text,
body.rin-admin-part .sidebar .nav-item .icon-only,
body.rin-admin-part .sidebar .nav-section-label,
body.rin-admin-part .sidebar .theme-label,
body.rin-admin-part .sidebar .sidebar-toggle,
body.rin-admin-part .sidebar .sidebar-search-toggle,
body.rin-admin-part .sidebar .sidebar-search-icon,
body.rin-admin-part .mobile-navbar,
body.rin-admin-part .mobile-navbar .mobile-brand-link,
body.rin-admin-part .mobile-navbar .brand-text-small,
body.rin-admin-part .mobile-navbar .brand-text-small h3,
body.rin-admin-part .mobile-navbar .brand-text-small span {
  color: #f7fcff;
}
body.rin-admin-part .sidebar .nav-item {
  color: rgba(247, 252, 255, 0.94);
}
body.rin-admin-part .sidebar .nav-item.active {
  background: rgba(255,255,255,0.2);
  color: #ffffff;
  box-shadow: inset 3px 0 0 #ffffff;
}
body.rin-admin-part .sidebar .nav-item:hover {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
}
body.rin-admin-part .sidebar .nav-section-label {
  color: rgba(247, 252, 255, 0.72);
}
body.rin-admin-part .sidebar .sidebar-toggle,
body.rin-admin-part .sidebar .sidebar-search-toggle {
  border-color: rgba(255,255,255,0.38);
  background: rgba(0,159,221,0.52);
}
body.rin-admin-part .sidebar .sidebar-toggle:hover,
body.rin-admin-part .sidebar .sidebar-search-toggle:hover {
  border-color: rgba(255,255,255,0.62);
  background: rgba(255,255,255,0.18);
  color: #ffffff;
}
body.rin-admin-part .sidebar .sidebar-search-input {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.24);
  color: #ffffff;
}
body.rin-admin-part .sidebar .sidebar-search-input::placeholder {
  color: rgba(247, 252, 255, 0.78);
}
body.rin-admin-part .sidebar .theme-toggle-section {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.24);
}

/* ── Synthesized Table Monrad Draw Styles (Retained for Backwards Compatibility) ── */
.draw-wrapper {
  background: transparent;
  padding: 10px 0;
  overflow-x: auto;
}
.scores-draw-table {
  border-collapse: separate !important;
  border-spacing: 24px 8px !important;
  margin: 0 auto;
}
.scores-draw-table thead td {
  font-family: 'Outfit', sans-serif !important;
  font-size: 11px !important;
  text-transform: uppercase !important;
  letter-spacing: 1.5px !important;
  color: var(--text-muted, #8a93a3) !important;
  font-weight: 700 !important;
  text-align: center !important;
  padding: 12px 16px !important;
  border: none !important;
  background: transparent !important;
}
.scores-draw-entry-box-table {
  background: var(--surface, #ffffff) !important;
  border: 1px solid var(--surface-border, #d8dde4) !important;
  border-radius: var(--r-md, 0.375rem) !important;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05)) !important;
  width: 220px !important;
  border-collapse: collapse !important;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s !important;
  overflow: hidden !important;
}
.scores-draw-entry-box-table:hover {
  border-color: var(--teal, #0d9488) !important;
  box-shadow: 0 0 12px var(--teal-glow-lg, rgba(13, 148, 136, 0.15)) !important;
  transform: translateY(-1px) !important;
}
.scores-draw-entry-box-table td {
  padding: 8px 12px !important;
  font-size: 13px !important;
  border: none !important;
  background: transparent !important;
  vertical-align: middle !important;
}
.scores-draw-entry-box-table tr:first-child td {
  border-bottom: 1px solid var(--surface-border, #f1f3f5) !important;
}
.scores-draw-entry-box-table td.first-round-el-participant {
  text-align: left !important;
  padding-left: 8px !important;
}
.scores-draw-entry-box-wrapper {
  background: var(--surface, #ffffff) !important;
  border: 1px solid var(--surface-border, #d8dde4) !important;
  border-radius: var(--r-md, 0.375rem) !important;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05)) !important;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s !important;
  position: relative !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 12px !important;
  width: 220px !important;
  float: left !important;
  margin-top: 10px !important;
}
.scores-draw-entry-box-wrapper:hover {
  border-color: var(--teal, #0d9488) !important;
  box-shadow: 0 0 12px var(--teal-glow-lg, rgba(13, 148, 136, 0.15)) !important;
  transform: translateY(-1px) !important;
}
.scores-draw-entry-box-players-item {
  font-family: 'Outfit', sans-serif !important;
  font-weight: 600 !important;
  color: var(--text, #1e293b) !important;
  font-size: 13px !important;
  text-decoration: none !important;
  transition: color 0.2s !important;
  display: inline-block !important;
  max-width: 140px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  vertical-align: middle !important;
}
.scores-draw-entry-box-players-item:hover {
  color: var(--teal, #0d9488) !important;
  text-decoration: none !important;
}
.scores-draw-entry-box-wrapper .scores-draw-entry-box {
  background: transparent !important;
  border: none !important;
  padding: 8px 0 !important;
  float: none !important;
  width: auto !important;
  display: flex !important;
  align-items: center !important;
}
.scores-draw-entry-box-score-wrapper {
  background: var(--surface-hover, #f8f9fa) !important;
  color: var(--text, #1e293b) !important;
  font-family: 'Outfit', sans-serif !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  border-radius: 6px !important;
  padding: 2px 6px !important;
  min-width: 26px !important;
  text-align: center !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
  border: 1px solid var(--surface-border, #d8dde4) !important;
  display: inline-block !important;
}
.scores-draw-entry-box-wrapper:hover .scores-draw-entry-box-score-wrapper {
  background: var(--teal, #0d9488) !important;
  color: #ffffff !important;
  border-color: var(--teal, #0d9488) !important;
}
.sep-bot { border-bottom: 2px solid var(--surface-border, #d8dde4) !important; }
.sep-left { border-left: 2px solid var(--surface-border, #d8dde4) !important; }
.stage-sep { border-left: 2px solid var(--surface-border, #d8dde4) !important; }

/* ── EDIT PENCIL BUTTON (inline after "Матч X") ── */
/* Scope to .threeDotsPopover to avoid un-hiding the second hidden anchor */

/* Reset hardcoded height from PHP (e.g. height:464px) that breaks flex layout in match-header.
   The threeDotsPopover variant below still gets its 20px button. */
.match-card a.scores-draw-h2h-link {
  display: inline !important;
  height: auto !important;
  width: auto !important;
  min-height: 0 !important;
}

.match-card a.scores-draw-h2h-link.threeDotsPopover {
  position: static !important;
  top: auto !important;
  right: auto !important;
  transform: none !important;
  height: 20px !important;
  width: 20px !important;
  background: var(--surface-hover) !important;
  border: 1px solid var(--surface-border) !important;
  color: var(--text-muted) !important;
  font-size: 12px !important;
  margin: 0 0 0 6px !important;
  float: none !important;
  display: inline-flex !important;
  flex-shrink: 0 !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  border-radius: 6px !important;
  transition: background var(--transition), color var(--transition), border-color var(--transition) !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.match-card a.scores-draw-h2h-link.threeDotsPopover:hover {
  background: var(--teal-glow) !important;
  color: var(--teal) !important;
  border-color: var(--teal) !important;
  transform: scale(1.15) !important;
}

.match-card a.scores-draw-h2h-link.threeDotsPopover * {
  display: none !important;
}

.match-card a.scores-draw-h2h-link.threeDotsPopover::before {
  content: "✏️" !important;
  font-size: 11px !important;
  line-height: 1 !important;
  display: inline-block !important;
}

/* Monrad badges — same on admin + public */
.match-header .badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 8px !important;
  font-weight: 600 !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  font-family: 'Outfit', sans-serif !important;
  letter-spacing: 0.3px !important;
  text-transform: uppercase !important;
  line-height: 1.4 !important;
  margin-left: auto !important;
  border: 1px solid transparent !important;
}
.match-header .badge.good {
  background: rgba(22, 163, 74, 0.12) !important;
  color: #16a34a !important;
  border-color: rgba(22, 163, 74, 0.25) !important;
}
.match-header .badge.warn {
  background: rgba(234, 179, 8, 0.12) !important;
  color: #ca8a04 !important;
  border-color: rgba(234, 179, 8, 0.25) !important;
}
.match-header .badge.info {
  background: rgba(59, 130, 246, 0.12) !important;
  color: #2563eb !important;
  border-color: rgba(59, 130, 246, 0.25) !important;
}
.match-header .badge.danger {
  background: rgba(220, 38, 38, 0.12) !important;
  color: #dc2626 !important;
  border-color: rgba(220, 38, 38, 0.25) !important;
}

/* Game details visible in footer */
.match-score .game-details {
  display: inline-flex;
  gap: 3px;
}

/* Footer area — total score */
.match-score {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}
.match-score .results {
  flex-shrink: 0 !important;
}

/* Per-row game scores (colored per-game, next to player name) */
.match-game-scores {
  display: inline-flex;
  gap: 3px;
  margin-left: 6px;
}
.match-game-scores .gs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 3px;
  padding: 0 3px;
  font-family: 'Outfit', sans-serif;
}
.match-game-scores .gs.win {
  background: rgba(22, 163, 74, 0.15);
  color: #16a34a;
}
.match-game-scores .gs.loss {
  background: rgba(100, 116, 139, 0.1);
  color: #94a3b8;
}
.match-game-scores .gs.pending {
  background: rgba(234, 179, 8, 0.1);
  color: #ca8a04;
}

/* Match duration (e.g. "0:18") — used inside .match-footer */
.match-duration {
  display: inline-block;
  font-size: 12px;
  opacity: 0.7;
  font-weight: 400;
  font-family: 'Outfit', sans-serif;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

/* Match footer (total score + duration, e.g. "0-3 (0:54)") */
.match-footer {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--surface-border);
  background: var(--surface-hover);
  font-family: 'Outfit', sans-serif;
  border-bottom-left-radius: var(--r-md, 8px);
  border-bottom-right-radius: var(--r-md, 8px);
}
.match-footer .match-total-score {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
}

/* VS Badge — gender-based colors */
.vs-badge {
  font-size: 9px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-block;
  margin: 0 10px;
}

.vs-badge.vs-women {
  color: hsl(340, 80%, 60%);
  background: hsl(340, 80%, 60%, 0.1);
  border: 1px solid hsl(340, 80%, 60%, 0.25);
  box-shadow: 0 2px 8px rgba(244,63,94,0.15);
  padding: 3px;
  font-size: 10px;
}

.vs-badge.vs-men {
  color: hsl(210, 80%, 50%);
  background: hsl(210, 80%, 50%, 0.1);
  border: 1px solid hsl(210, 80%, 50%, 0.25);
  box-shadow: 0 2px 8px rgba(30, 100, 245, 0.18);
  padding: 3px;
  font-size: 10px;
}

[data-theme="dark"] .vs-badge.vs-women {
  color: hsl(340, 80%, 65%);
  background: hsl(340, 80%, 60%, 0.15);
  border-color: hsl(340, 80%, 60%, 0.35);
  box-shadow: 0 2px 8px rgba(244,63,94,0.25);
}

[data-theme="dark"] .vs-badge.vs-men {
  color: hsl(210, 80%, 60%);
  background: hsl(210, 80%, 50%, 0.1);
  border-color: hsl(210, 80%, 50%, 0.35);
  box-shadow: 0 2px 8px rgba(30, 100, 245, 0.28);
}

/* ═══════════════════════════════════════════════════════════════════
   LAYER — Organization Hero
   Premium gradient banner for /organisation/$id/
   ═══════════════════════════════════════════════════════════════════ */

.org-hero {
  position: relative;
  background: linear-gradient(135deg, var(--teal) 0%, var(--blue) 60%, var(--teal-light) 100%);
  border-radius: var(--r-xl);
  padding: 44px 40px;
  margin-bottom: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  color: #fff;
  isolation: isolate;
}

.org-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255,255,255,0.12) 0%, transparent 38%),
    radial-gradient(circle at 82% 78%, rgba(255,255,255,0.10) 0%, transparent 42%);
  pointer-events: none;
  z-index: 0;
}

.org-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
  opacity: 0.45;
  z-index: 0;
}

.org-hero-shapes { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.org-hero-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: floatShape 9s ease-in-out infinite;
}
.org-hero-shape-1 { width: 220px; height: 220px; background: rgba(255,255,255,0.30); top: -60px; left: -60px; }
.org-hero-shape-2 { width: 170px; height: 170px; background: rgba(255,255,255,0.22); bottom: -50px; right: -40px; animation-delay: -3s; }
.org-hero-shape-3 { width: 130px; height: 130px; background: rgba(255,255,255,0.16); top: 25%; right: 28%; animation-delay: -5s; }

@keyframes floatShape {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(18px, -22px); }
}

.org-hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
}

.org-hero-logo-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}
.org-hero-logo {
  width: 96px;
  height: 96px;
  border-radius: var(--r-lg);
  border: 3px solid rgba(255,255,255,0.92);
  background: #fff;
  object-fit: cover;
  position: relative;
  z-index: 2;
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
}
.org-hero-logo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 116px;
  height: 116px;
  background: rgba(255,255,255,0.45);
  border-radius: 50%;
  filter: blur(28px);
  z-index: 1;
  animation: pulseGlow 3s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 0.75; transform: translate(-50%, -50%) scale(1.10); }
}
.org-hero-logo-fallback {
  width: 96px;
  height: 96px;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.20);
  border: 3px solid rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  position: relative;
  z-index: 2;
}

.org-hero-text { min-width: 0; }

.org-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.30);
  border-radius: 99px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
  animation: slideDownFade 0.5s ease-out;
}
.org-hero-badge-icon { color: #fbbf24; font-size: 14px; line-height: 1; }

@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.org-hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.12;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 6px rgba(0,0,0,0.12);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.org-hero-meta {
  font-size: 14px;
  opacity: 0.96;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  line-height: 1.5;
}
.org-hero-meta .flag-icon { border-radius: 3px; box-shadow: 0 1px 2px rgba(0,0,0,0.20); }
.org-hero-meta .meta-sep { opacity: 0.55; }

.org-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.org-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 22px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s;
  text-decoration: none;
  line-height: 1;
}
.org-hero-btn-primary {
  background: #fff;
  color: var(--teal);
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.org-hero-btn-primary:hover  { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.22); }
.org-hero-btn-primary:active { transform: translateY(0); }
.org-hero-btn-primary:disabled,
.org-hero-btn-primary[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.org-hero-btn-secondary {
  background: rgba(255,255,255,0.10);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.30);
}
.org-hero-btn-secondary:hover { background: rgba(255,255,255,0.22); transform: translateY(-2px); }
.org-hero-btn-secondary:active { transform: translateY(0); }

.org-hero-btn-icon { width: 16px; height: 16px; flex-shrink: 0; }

@media (max-width: 768px) {
  .org-hero           { padding: 32px 22px; border-radius: var(--r-lg); }
  .org-hero-content   { grid-template-columns: 1fr; text-align: center; gap: 18px; }
  .org-hero-logo-wrap { margin: 0 auto; }
  .org-hero-title     { font-size: 26px; }
  .org-hero-meta      { justify-content: center; }
  .org-hero-actions   { justify-content: center; }
  .org-hero-shape-1   { width: 140px; height: 140px; }
  .org-hero-shape-2   { width: 110px; height: 110px; }
  .org-hero-shape-3   { display: none; }
}

/* ── KPI icon variants (replaces emoji with refined SVG/initial-style badges) ── */
.kpi-icon.kpi-icon-members { background: linear-gradient(135deg, rgba(13,148,136,0.18), rgba(20,184,166,0.18)); color: var(--teal); }
.kpi-icon.kpi-icon-tournaments { background: linear-gradient(135deg, rgba(37,99,235,0.18), rgba(96,165,250,0.18)); color: var(--blue); }
.kpi-icon.kpi-icon-weeks { background: linear-gradient(135deg, rgba(217,119,6,0.18), rgba(251,191,36,0.18)); color: var(--amber); }
.kpi-icon.kpi-icon-calendar { background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(167,139,250,0.18)); color: #7c3aed; }
.kpi-icon svg { width: 22px; height: 22px; }

/* ── Contacts strip below hero ── */
.org-contacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.org-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition);
}
.org-contact-item:hover { border-color: var(--teal); color: var(--text); }
.org-contact-item .contact-ico {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--teal-glow);
  color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.org-contact-item .contact-ico svg { width: 16px; height: 16px; }
.org-contact-item a {
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: inline-block;
}
.org-contact-item a:hover { color: var(--teal); }
.org-contact-item strong { color: var(--text); font-weight: 600; }

/* ── Layout grid: 2 columns main + sidebar ── */
.org-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 980px) { .org-layout { grid-template-columns: 1fr; } }

/* ── Tabs (organization-specific; primary accent line) ── */
.org-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-md);
  padding: 4px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.org-tab {
  flex: 1;
  padding: 10px 14px;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-sm);
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  border: none;
  background: transparent;
}
.org-tab:hover { color: var(--text); background: var(--surface-hover); }
.org-tab.active { background: var(--teal); color: #fff; box-shadow: 0 2px 8px var(--teal-glow); }

/* ── Members list (used inside Top-Ten block) ── */
.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--surface-border);
}
.member-row:last-child { border-bottom: 0; }
.member-rank {
  width: 28px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
}
.member-row .player-avatar { width: 32px; height: 32px; font-size: 11px; }
.member-row .player-name { font-size: 13px; }

/* ── Empty state in tabs ── */
.org-tab-panel .empty-state { padding: 32px 20px; }

/* ═══════════════════════════════════════════════════════════════════
   LAYER — Organisation About block
   "О клубе" section with icon + description
   ═══════════════════════════════════════════════════════════════════ */
.org-about {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-left: 3px solid var(--teal);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.org-about-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  background: var(--teal-glow);
  color: var(--teal);
  display: flex; align-items: center; justify-content: center;
}
.org-about-icon svg { width: 20px; height: 20px; }
.org-about-body { min-width: 0; flex: 1; }
.org-about-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.org-about-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  white-space: pre-line; /* honor newlines from textarea description */
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .org-about { flex-direction: column; gap: 12px; padding: 18px 20px; }
}

/* ═══════════════════════════════════════════════════════════════════
   LAYER — Organisation Tournament Cards
   Replaces the legacy .body-row grid inside the calendar tab panels
   ═══════════════════════════════════════════════════════════════════ */
.org-tab-panel { display: flex; flex-direction: column; gap: 12px; }

.org-tournament-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.org-tournament-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--teal);
}
.org-tournament-card--finished { opacity: 0.78; }

.org-tournament-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--teal-glow-lg), var(--teal-glow));
  border: 1px solid var(--teal);
  border-radius: var(--r-md);
  padding: 8px 6px;
  min-height: 72px;
  text-align: center;
  color: var(--teal);
}
.org-tournament-card--finished .org-tournament-date {
  background: var(--surface-hover);
  border-color: var(--surface-border);
  color: var(--text-muted);
}
.org-tournament-day {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}
.org-tournament-month {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}
.org-tournament-year {
  font-size: 9px;
  color: var(--text-subtle);
  margin-top: 1px;
}

.org-tournament-info { min-width: 0; }
.org-tournament-name {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.35;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.org-tournament-name a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}
.org-tournament-name a:hover { color: var(--teal); }

.org-tournament-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.org-tournament-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.org-tournament-meta-item svg { width: 13px; height: 13px; flex-shrink: 0; opacity: 0.7; }
.org-tournament-meta-club { color: var(--teal); font-weight: 500; }

.org-tournament-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.org-tournament-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--teal);
  color: #fff;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 6px var(--teal-glow);
  font-family: inherit;
  line-height: 1.2;
}
.org-tournament-cta:hover {
  background: var(--teal-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--teal-glow-lg);
  color: #fff;
}
.org-tournament-status {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-hover);
  color: var(--text-muted);
  border: 1px solid var(--surface-border);
}
.org-tournament-status--finished {
  background: var(--surface-hover);
  color: var(--text-subtle);
}

@media (max-width: 600px) {
  .org-tournament-card {
    grid-template-columns: 60px 1fr;
    gap: 12px;
    padding: 14px 16px;
  }
  .org-tournament-date { min-height: 60px; padding: 6px 4px; }
  .org-tournament-day { font-size: 20px; }
  .org-tournament-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }
  .org-tournament-cta { width: 100%; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════════════
   LAYER — Organisation Member Row (sidebar table)
   Avatar + name + points cell layout
   ═══════════════════════════════════════════════════════════════════ */
.org-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.org-member-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.org-member-name {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition);
}
.org-member-name:hover { color: var(--teal); }
.org-member-points {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--teal);
  font-size: 13px;
}
.org-rank {
  display: inline-block;
  min-width: 22px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface-hover);
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
