@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Light Mode Palette */
  --bg-color: hsl(210, 20%, 98%);
  --card-bg: hsl(0, 0%, 100%);
  --text-color: hsl(222, 47%, 11%);
  --text-muted: hsl(215, 16%, 47%);
  --border-color: hsl(214, 32%, 91%);
  --primary-color: hsl(238, 75%, 60%);
  --primary-hover: hsl(238, 75%, 52%);
  --primary-light: hsl(238, 75%, 96%);
  --accent-color: hsl(262, 80%, 60%);
  --danger-color: hsl(0, 72%, 51%);
  --danger-hover: hsl(0, 72%, 45%);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --sidebar-width: 420px;
}

body.dark-mode {
  /* Dark Mode Palette */
  --bg-color: hsl(222, 47%, 6%);
  --card-bg: hsl(222, 47%, 10%);
  --text-color: hsl(210, 20%, 98%);
  --text-muted: hsl(215, 20%, 65%);
  --border-color: hsl(222, 47%, 16%);
  --primary-color: hsl(238, 85%, 66%);
  --primary-hover: hsl(238, 85%, 72%);
  --primary-light: hsl(222, 47%, 14%);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Main Layout Grid */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header & Navbar */
header {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.nav-content {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  background-color: var(--primary-light);
  color: var(--primary-color);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap !important;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
}

.dropdown-item {
  transition: all 0.15s ease;
}

.dropdown-item:hover {
  background-color: var(--primary-light) !important;
  color: var(--primary-color) !important;
}

.dropdown-item i {
  flex-shrink: 0;
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  user-select: none;
  touch-action: manipulation;
}

.btn * {
  pointer-events: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--card-bg);
  color: var(--text-color);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background-color: var(--card-bg);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  color: var(--text-color);
  border-color: var(--text-muted);
  background-color: var(--primary-light);
}

/* Main Dashboard Area */
main {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Search and Filters Bar - Modern & Catchy */
.search-filter-section {
  position: relative;
  background-color: var(--card-bg);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xl, 20px);
  padding: 1.15rem 1.35rem;
  box-shadow: 0 10px 30px -10px rgba(79, 70, 229, 0.08), 0 4px 16px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.search-filter-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4f46e5, #06b6d4, #ec4899, #f59e0b);
  border-top-left-radius: var(--radius-xl, 20px);
  border-top-right-radius: var(--radius-xl, 20px);
}

.modern-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  border-radius: 16px;
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) inset;
}

.modern-search-wrapper:focus-within {
  border-color: #6366f1 !important;
  background: var(--card-bg) !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 8px 24px rgba(99, 102, 241, 0.12) !important;
  transform: translateY(-1px);
}

.search-icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.85rem 0 1.1rem;
  color: #6366f1;
  pointer-events: none;
}

.modern-search-input {
  width: 100% !important;
  font-family: var(--font-sans) !important;
  font-size: 1.02rem !important;
  font-weight: 600 !important;
  padding: 0.95rem 1rem 0.95rem 0.5rem !important;
  border: none !important;
  background: transparent !important;
  color: var(--text-color) !important;
  outline: none !important;
  box-shadow: none !important;
}

.modern-search-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.92rem;
  opacity: 0.75;
}

.search-clear-btn {
  background: rgba(148, 163, 184, 0.2);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  margin-right: 0.5rem;
  transition: all 0.2s ease;
}

.search-clear-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  transform: scale(1.08);
}

.search-kbd-hint {
  display: none !important;
  padding-right: 1.1rem;
  align-items: center;
}

.search-kbd-hint span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(6, 182, 212, 0.12));
  color: #4f46e5;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  white-space: nowrap;
}

/* Quick Search Suggestion Tags */
.quick-search-tags {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding-left: 0.25rem;
}

.quick-search-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.quick-tag-btn {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-color);
  background: var(--bg-color);
  border: 1.5px solid var(--border-color);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.quick-tag-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #ffffff;
  border-color: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.25);
}

.quick-tag-btn.active {
  background: linear-gradient(135deg, #1e40af, #2563eb) !important;
  color: #ffffff !important;
  border-color: #1e40af !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
  font-weight: 800;
}

.filters-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.modern-filters-wrapper {
  margin-top: 0.2rem !important;
}

.select-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.modern-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.modern-filter-select {
  font-family: var(--font-sans) !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  padding: 0.65rem 2.2rem 0.65rem 1rem !important;
  border-radius: 12px !important;
  border: 1.5px solid var(--border-color) !important;
  background-color: var(--bg-color) !important;
  color: var(--text-color) !important;
  outline: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02) !important;
}

.modern-filter-select:hover {
  border-color: #6366f1 !important;
}

.modern-filter-select:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

.select-wrapper::after {
  content: '↓';
  font-size: 0.75rem;
  color: var(--text-muted);
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.view-controls {
  display: flex;
  align-items: center;
  background-color: var(--bg-color);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 0.25rem;
}

.view-btn {
  background: transparent;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.8rem;
  transition: var(--transition);
}

.view-btn.active {
  background-color: var(--card-bg);
  color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

/* Stats and Active Filters Row */
.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 100%;
  max-width: 1440px;
  margin: -0.25rem auto 0 auto;
  padding: 0 0.25rem;
  box-sizing: border-box;
}

.stats-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  margin-left: auto;
  white-space: nowrap;
}

.active-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-badge {
  background-color: var(--primary-light);
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-badge button {
  background: transparent;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
}

/* Grid & List Views */
.directory-container {
  min-height: 400px;
}

/* Grid Mode */
.directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.member-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.member-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  opacity: 0;
  transition: var(--transition);
}

.member-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

.member-card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 1.15rem;
  margin-bottom: 1.25rem;
}

.admin-card-edit-btn {
  display: none !important;
}

/* Avatar generator */
.avatar {
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-title-wrap {
  min-width: 0;
  flex: 1;
}

.member-name {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
  word-break: break-word;
  line-height: 1.3;
}

.member-role {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: normal !important;
  word-break: break-word !important;
  line-height: 1.35 !important;
  overflow: visible !important;
  text-overflow: unset !important;
}

.member-dept {
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-top: 0.25rem;
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.member-meta-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.member-meta-item svg {
  flex-shrink: 0;
  color: var(--primary-color);
}

/* List Mode (Table View) */
.directory-list {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
}

.directory-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.directory-table th, .directory-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}

.directory-table th {
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--primary-light);
  user-select: none;
}

.directory-table tr {
  cursor: pointer;
  transition: var(--transition);
}

.directory-table tr:hover {
  background-color: var(--primary-light);
}

.table-member-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.table-member-cell .avatar {
  width: 36px;
  height: 36px;
  font-size: 0.875rem;
}

.table-name-wrap {
  display: flex;
  flex-direction: column;
}

.table-name {
  font-weight: 600;
}

/* Sidebar Profile Popup Window Modal (Details View) */
.sidebar-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(4px) !important;
  z-index: 10000 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.25s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1.25rem !important;
  box-sizing: border-box !important;
}

.sidebar-overlay.active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.profile-sidebar {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: 100% !important;
  max-width: 560px !important;
  max-height: 90vh !important;
  background-color: var(--card-bg) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--border-color) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-xl) !important;
  z-index: 10001 !important;
  transform: scale(0.92) !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.sidebar-overlay.active .profile-sidebar {
  transform: scale(1) !important;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.sidebar-avatar {
  width: 130px;
  height: 130px;
  min-width: 130px;
  min-height: 130px;
  max-width: 130px;
  max-height: 130px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.75rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.sidebar-info-block {
  width: 100%;
  text-align: left;
  background-color: var(--bg-color);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.info-val {
  font-size: 0.95rem;
  font-weight: 500;
  word-break: break-all;
}

.info-val a {
  color: var(--primary-color);
  text-decoration: none;
}

.info-val a:hover {
  text-decoration: underline;
}

.sidebar-actions {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.75rem;
}

.sidebar-actions button {
  flex: 1;
}

/* Modal styling (for Excel Upload) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content,
.modal-card {
  background-color: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 540px;
  overflow: hidden;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, color 0.3s ease;
}

.modal-overlay.active .modal-content,
.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Drag and Drop Zone */
.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--bg-color);
}

.drop-zone.dragover {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
}

.drop-zone-icon {
  color: var(--primary-color);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.drop-zone-text {
  font-size: 0.875rem;
  font-weight: 500;
}

.drop-zone-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.file-input {
  display: none;
}

/* Mapping Panel */
.mapping-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mapping-title {
  font-size: 0.875rem;
  font-weight: 600;
}

.mapping-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.mapping-row {
  display: contents;
}

.mapping-label {
  display: flex;
  align-items: center;
  font-weight: 500;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Empty State styling */
.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
}

.empty-state-icon {
  background-color: var(--primary-light);
  color: var(--primary-color);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  header {
    padding: 0.75rem 1rem;
  }
  
  main {
    padding: 0.75rem 0.85rem;
    gap: 0.85rem;
  }
  
  .search-filter-section {
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }
  
  .filters-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
  
  .select-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .select-wrapper, .filter-select {
    width: 100%;
  }
  
  .directory-grid {
    grid-template-columns: 1fr;
  }
  
  .profile-sidebar {
    width: 100%;
    max-width: 560px;
  }
}

/* Pagination controls */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2rem;
  padding: 1rem 0;
}

.pagination-info {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Google Auth Sign In Styles */
.login-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.1) 0%, transparent 45%),
              radial-gradient(circle at 85% 85%, rgba(245, 158, 11, 0.08) 0%, transparent 45%),
              radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 60%),
              #f8fafc;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 1.5rem 1rem;
  box-sizing: border-box;
  transition: opacity 0.3s ease;
}

.login-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  padding: 2.25rem 2rem;
  max-width: 440px;
  width: min(440px, 94vw);
  text-align: center;
  box-shadow: 0 25px 60px -15px rgba(30, 58, 138, 0.16), 0 8px 24px -6px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
  box-sizing: border-box;
  position: relative;
}

.login-logo-img {
  width: 90px;
  height: 90px;
  border-radius: 20px;
  object-fit: contain;
  margin-bottom: 0.85rem;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-logo-img:hover {
  transform: scale(1.06) rotate(-2deg);
}

.login-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.login-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

#otp-code-input::placeholder {
  font-size: 0.8rem;
  letter-spacing: normal;
  font-weight: 500;
  color: #94a3b8;
}

/* User profile widget in header */
.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--primary-light);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-color);
}

@media (max-width: 600px) {
  .user-name {
    display: none;
  }
}

/* Directory Tabs Selector (Hidden in dedicated screen app model) */
.directory-tabs {
  display: none !important;
}

.tab-btn {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
}

.tab-btn:hover {
  color: var(--text-color);
  background-color: var(--bg-hover);
}

.tab-btn.active {
  background-color: var(--primary-color);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

/* App Module Launcher Grid (Universal Responsive Launcher) */
#app-home-section {
  width: 100%;
  max-width: 1180px;
  margin: 1.5rem auto !important;
  padding: 0 1rem;
  box-sizing: border-box;
}

.module-launcher-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 1.25rem 1.15rem;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto 1.5rem auto;
  box-sizing: border-box;
}

.module-card {
  flex: 0 1 155px;
  width: 155px;
  max-width: 165px;
  background: transparent !important;
  border: 1.5px solid transparent !important;
  border-radius: 18px;
  padding: 1.25rem 0.65rem 1rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: none !important;
  position: relative;
  user-select: none;
  box-sizing: border-box;
}

.module-card:hover {
  transform: translateY(-4px);
  background: rgba(37, 99, 235, 0.05) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.module-card:active {
  transform: translateY(-1px) scale(0.96);
  background: rgba(37, 99, 235, 0.1) !important;
}

.module-card.active,
.module-card:focus-visible {
  border-color: transparent !important;
  box-shadow: none !important;
}

.module-card-icon {
  width: 66px !important;
  height: 66px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-bottom: 0.65rem !important;
  transition: all 0.22s ease !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06) !important;
  flex-shrink: 0 !important;
}

.module-card:hover .module-card-icon {
  transform: scale(1.08);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12) !important;
}

.module-card-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.25;
  transition: color 0.2s ease;
  word-break: break-word;
}

.module-card.active .module-card-title {
  color: #2563eb;
  font-weight: 800;
}

/* Persistent Bottom App Bar (Hidden completely per user request) */
.mobile-bottom-nav,
.bottom-nav {
  display: none !important;
}

body {
  padding-bottom: 0 !important;
}

/* Settings & Profile Centered Modal Form */
.app-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10020;
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.app-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.app-drawer {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl, 20px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  z-index: 10021;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease;
}

.app-drawer-overlay.open .app-drawer,
.app-drawer.open {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Admin Dashboard Layout */
.admin-dashboard-section {
  padding: 2.5rem 1.5rem;
  max-width: 1200px;
  margin: 2rem auto;
  width: 100%;
}

.admin-dashboard-container {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.admin-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.stat-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  background-color: var(--primary-light);
  color: var(--primary-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-info h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-color);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-info p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.stat-actions {
  display: flex;
  gap: 1rem;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.stat-actions .btn-sm,
.stat-actions .btn {
  flex: 1;
  justify-content: center;
}

#subscreen-app-bar button,
#subscreen-app-bar .btn {
  flex: 0 0 auto !important;
  width: auto !important;
}

/* Copy & Select protection layout rules (active for everyone except superadmin) */
body.disable-copy,
body.disable-copy *:not(input):not(textarea):not(select):not([contenteditable="true"]) {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

body.disable-copy input,
body.disable-copy textarea,
body.disable-copy select,
body.disable-copy [contenteditable="true"] {
  -webkit-user-select: auto !important;
  -moz-user-select: auto !important;
  -ms-user-select: auto !important;
  user-select: auto !important;
  -webkit-touch-callout: default !important;
}

body.superadmin-unrestricted,
body.superadmin-unrestricted * {
  -webkit-user-select: auto !important;
  -moz-user-select: auto !important;
  -ms-user-select: auto !important;
  user-select: auto !important;
  -webkit-touch-callout: default !important;
}

/* Cabinet Officer Custom Card Styles */
.member-card.cabinet-officer {
  background-color: #E6E6FA !important;
}

body.dark-mode .member-card.cabinet-officer {
  background-color: hsl(240, 25%, 15%) !important;
}

.member-card.cabinet-officer .member-role {
  font-weight: 700 !important;
}

/* District Chairperson Custom Card Styles */
.member-card.district-chairperson {
  background-color: #E0F2F1 !important;
}

body.dark-mode .member-card.district-chairperson {
  background-color: hsl(170, 25%, 13%) !important;
}

/* ====================================================
   COMPREHENSIVE RESPONSIVE DESIGN (Mobile, Tablet, PC)
   ==================================================== */

/* ====================================================
   COMPREHENSIVE RESPONSIVE DESIGN (Desktop, Tablet, Mobile)
   ==================================================== */

/* --- DESKTOP ENHANCEMENTS (> 1024px) --- */
@media (min-width: 1025px) {
  .directory-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
  }
}

/* --- TABLET BREAKPOINT (601px - 1024px) --- */
@media (max-width: 1024px) {
  header {
    padding: 1rem 1.5rem;
  }

  main {
    padding: 1.25rem 1.5rem;
    gap: 1.25rem;
  }

  .directory-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .filters-wrapper {
    flex-wrap: wrap;
    gap: 0.85rem;
  }

  .select-filters {
    width: 100%;
    justify-content: flex-start;
  }

  .select-wrapper {
    flex: 1;
    min-width: 160px;
  }

  .filter-select {
    width: 100%;
  }

  .profile-sidebar {
    width: 100%;
    max-width: 560px;
  }
}

/* --- MOBILE BREAKPOINT (<= 600px) --- */
@media (max-width: 600px) {
  header {
    padding: 0.65rem 0.75rem;
  }

  .nav-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .brand h1 {
    font-size: 1.05rem;
    line-height: 1.1;
  }

  .brand-logo-img {
    width: 44px !important;
    height: 44px !important;
    border-radius: 9px !important;
  }

  .nav-actions {
    gap: 0.4rem;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
  }

  .user-profile {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem;
    max-width: 145px;
  }

  .user-name {
    display: inline-block;
    max-width: 75px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.76rem;
  }

  #user-memid-display {
    font-size: 0.68rem !important;
  }

  #open-celebrations-btn {
    padding: 0.32rem 0.6rem !important;
    font-size: 0.76rem !important;
  }

  .btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.76rem;
  }

  main {
    padding: 0.65rem;
    gap: 0.75rem;
  }

  .search-filter-section {
    padding: 0.65rem;
    gap: 0.6rem;
    border-radius: var(--radius-md);
  }

  .search-input {
    font-size: 0.85rem;
    padding: 0.55rem 0.75rem 0.55rem 2.25rem;
    min-height: 40px;
  }

  .search-icon {
    left: 0.75rem;
    width: 16px;
    height: 16px;
  }

  .directory-tabs {
    display: none !important;
  }

  .tab-btn {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    padding: 0.4rem 0.75rem !important;
    font-size: 0.78rem !important;
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.3rem !important;
  }

  .tab-btn i {
    width: 13px !important;
    height: 13px !important;
  }

  .filters-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .select-filters {
    flex-direction: column;
    width: 100%;
    gap: 0.45rem;
  }

  .select-wrapper {
    width: 100%;
  }

  .filter-select {
    width: 100%;
    font-size: 0.82rem;
    padding: 0.5rem 0.65rem;
    min-height: 38px;
  }

  .directory-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .member-card {
    padding: 0.85rem;
    border-radius: var(--radius-md);
  }

  .card-header {
    gap: 0.65rem;
    margin-bottom: 0.65rem;
  }

  .avatar {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    font-size: 1.15rem;
  }

  .member-name {
    font-size: 0.95rem;
  }

  .member-role {
    font-size: 0.76rem;
  }

  .member-meta-item {
    font-size: 0.78rem;
  }

  .profile-sidebar {
    width: 100%;
    max-width: 95vw;
    max-height: 90vh;
  }

  .sidebar-content {
    padding: 1.25rem 1rem;
    gap: 1rem;
  }

  .sidebar-avatar {
    width: 100px;
    height: 100px;
    min-width: 100px;
    min-height: 100px;
  }

  .pagination-container {
    flex-direction: column;
    gap: 0.6rem;
    align-items: center;
    text-align: center;
    padding: 0.6rem 0;
  }

  .login-card {
    width: 95%;
    padding: 1.5rem 1rem;
    border-radius: var(--radius-md);
  }

  .admin-dashboard-section {
    padding: 0.65rem;
    margin: 0.4rem auto;
  }

  .admin-dashboard-container {
    padding: 0.85rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .modal-content {
    width: 95vw;
    max-height: 92vh;
    padding: 1rem;
  }

  .table-member-cell {
    gap: 0.45rem;
  }

  .stats-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0 0.15rem;
  }

  .stats-count-badge {
    margin-left: auto;
    font-size: 0.78rem;
    padding: 0.22rem 0.65rem;
  }

  /* District Analytics & Health Reports on Mobile */
  #analytics-container {
    padding: 0.5rem 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  #analytics-container .analytics-card {
    padding: 0.85rem !important;
    border-radius: var(--radius-lg) !important;
    margin-bottom: 0.85rem !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .analytics-card-header-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.45rem !important;
    justify-content: flex-start !important;
    margin-top: 0.4rem !important;
  }

  #analytics-container h2 {
    font-size: 1.1rem !important;
    word-break: break-word !important;
  }

  #analytics-container h3 {
    font-size: 0.95rem !important;
    word-break: break-word !important;
  }

  #analytics-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
    margin-bottom: 0.85rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #analytics-kpi-grid > div {
    padding: 0.75rem 0.85rem !important;
    border-radius: var(--radius-md) !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .analytics-mobile-swipe-hint {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: rgba(99, 102, 241, 0.08) !important;
    border: 1px dashed rgba(99, 102, 241, 0.35) !important;
    border-radius: 8px !important;
    padding: 0.35rem 0.65rem !important;
    margin-bottom: 0.65rem !important;
    font-size: 0.74rem !important;
    font-weight: 700 !important;
    color: var(--primary-color, #4f46e5) !important;
  }

  .analytics-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border-color) !important;
    box-sizing: border-box !important;
  }

  #analytics-region-zone-table,
  #analytics-club-table,
  #analytics-container table {
    min-width: 780px !important;
    font-size: 0.76rem !important;
  }

  #analytics-region-zone-table th,
  #analytics-region-zone-table td,
  #analytics-club-table th,
  #analytics-club-table td,
  #analytics-container table th,
  #analytics-container table td {
    padding: 0.45rem 0.5rem !important;
  }

  /* Sticky First Column on Mobile for District Analytics */
  #analytics-region-zone-table th:first-child,
  #analytics-region-zone-table td:first-child,
  #analytics-club-table th:first-child,
  #analytics-club-table td:first-child {
    position: sticky !important;
    left: 0 !important;
    background: var(--card-bg, #ffffff) !important;
    z-index: 5 !important;
    min-width: 145px !important;
    max-width: 180px !important;
    box-shadow: 3px 0 6px -2px rgba(0, 0, 0, 0.12) !important;
    word-break: break-word !important;
  }

  #analytics-region-zone-table thead th:first-child,
  #analytics-club-table thead th:first-child {
    background: var(--bg-color, #f8fafc) !important;
    z-index: 6 !important;
  }

  #analytics-region-zone-table tfoot td:first-child,
  #analytics-club-table tfoot td:first-child {
    background: rgba(79, 70, 229, 0.12) !important;
    z-index: 6 !important;
  }

  #analytics-region-zone-table tr[style*="rgba(99, 102, 241"] td:first-child {
    background: #f8fafc !important;
  }

  /* Superadmin Panel Reports & Tables */
  .admin-dashboard-section {
    padding: 0.5rem !important;
    margin: 0.25rem auto !important;
  }

  .admin-dashboard-container {
    padding: 0.75rem !important;
  }

  .admin-dashboard-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.65rem !important;
    margin-bottom: 1rem !important;
    padding-bottom: 0.75rem !important;
  }

  .admin-dashboard-header .admin-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
  }

  .admin-dashboard-header .admin-actions .btn {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }

  .admin-dashboard-container table {
    min-width: 560px;
    font-size: 0.78rem !important;
  }

  .admin-dashboard-container th,
  .admin-dashboard-container td {
    padding: 0.45rem 0.55rem !important;
  }

  /* Vault Responsive */
  #vault-container {
    padding: 0.5rem 0 !important;
  }

  #vault-container > div:first-child {
    padding: 1.25rem 0.85rem !important;
    border-radius: var(--radius-lg) !important;
  }

  #vault-container h2 {
    font-size: 1.2rem !important;
  }

  /* Organisation Chart Responsive */
  #hierarchy-container {
    padding: 0.5rem 0 !important;
  }

  /* Broadcasts Circulars Responsive */
  #broadcasts-container {
    padding: 0.5rem 0 !important;
  }
}

/* Club Officers Modal Filter Ribbon - Responsive Grid */
#club-officers-filter-ribbon {
  background: var(--card-bg) !important;
  border-bottom: 1.5px solid var(--border-color) !important;
  padding: 0.75rem 1rem !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.5rem !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  z-index: 50 !important;
  position: relative !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

.club-officer-title-select {
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  padding: 0.5rem 0.55rem !important;
  border: 1.5px solid var(--border-color) !important;
  background: var(--bg-color) !important;
  color: var(--text-color) !important;
  transition: all 0.2s ease-in-out !important;
  width: 100% !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  outline: none !important;
  height: 38px !important;
  min-height: 38px !important;
}

.club-officer-title-select:focus,
.club-officer-title-select:hover {
  border-color: var(--primary-color) !important;
}

.club-officer-title-select.has-selection {
  border-color: #4f46e5 !important;
  background: rgba(79, 70, 229, 0.08) !important;
  color: #4f46e5 !important;
  font-weight: 800 !important;
}

.club-officer-filter-btn {
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  padding: 0.5rem 0.65rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  cursor: pointer !important;
  border: 1.5px solid var(--border-color) !important;
  background: var(--bg-color) !important;
  color: var(--text-color) !important;
  transition: all 0.2s ease-in-out !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  width: auto !important;
  box-sizing: border-box !important;
  text-align: center !important;
}

.club-officer-filter-btn:hover {
  border-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
  transform: translateY(-1px);
}

.club-officer-filter-btn.active {
  background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
  color: #ffffff !important;
  border-color: #4f46e5 !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35) !important;
  transform: translateY(-1px);
}

.club-officer-filter-btn .filter-count-badge {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  padding: 0.12rem 0.45rem !important;
  border-radius: 10px !important;
  background: rgba(79, 70, 229, 0.12) !important;
  color: var(--primary-color) !important;
  display: inline-block !important;
  line-height: 1 !important;
}

.club-officer-filter-btn.active .filter-count-badge {
  background: rgba(255, 255, 255, 0.28) !important;
  color: #ffffff !important;
}

#club-officers-modal .modal-card {
  max-width: 880px !important;
  width: 95% !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#club-officers-modal-body {
  padding: 1.5rem !important;
  overflow-y: auto !important;
  flex: 1 1 auto !important;
  min-height: 250px !important;
  background: var(--bg-color) !important;
  box-sizing: border-box !important;
}

/* --- ULTRA RESPONSIVE ENHANCEMENTS FOR ALL DEVICES --- */

/* Touch-friendly inputs and buttons */
button, input, select, textarea {
  font-family: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Fluid Login Screen Container & Card */
.login-screen-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  padding: 1.25rem 1rem;
  box-sizing: border-box;
  overflow-y: auto;
}

.login-card {
  width: min(440px, 94vw);
  box-sizing: border-box;
  margin: auto;
}

#google-btn-container,
#email-otp-section,
#guest-login-btn {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Responsive Table Wrappers for Small Screens */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

/* Responsive Grid Adjustments */
@media (min-width: 601px) and (max-width: 1024px) {
  main {
    padding: 1.25rem;
  }

  .directory-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
  }

  .search-filter-section {
    padding: 1.15rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 13.5px;
  }

  .login-card {
    padding: 1.35rem 0.9rem !important;
  }

  .brand h1 {
    font-size: 0.95rem;
  }

  .btn {
    min-height: 38px;
    font-size: 0.78rem;
  }

  .search-input {
    min-height: 38px;
  }

  .filter-select {
    min-height: 38px;
  }

  .tab-btn {
    min-height: 34px !important;
  }

  .member-card {
    padding: 0.75rem;
  }
}

/* ====================================================
   Lions Honors, Awards & Badges ("Hall of Fame")
   ==================================================== */
.prestige-badges {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ====================================================
   District Leadership Hierarchy & Org Chart
   ==================================================== */
.hierarchy-card {
  transition: all 0.25s ease;
}

.hierarchy-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

.hierarchy-dg-card {
  background: linear-gradient(145deg, var(--card-bg), rgba(245, 158, 11, 0.05)) !important;
}

body.dark-mode .hierarchy-dg-card {
  background: linear-gradient(145deg, var(--card-bg), rgba(245, 158, 11, 0.12)) !important;
}

/* ====================================================
   Today's Celebrations (Birthdays & Anniversaries)
   ==================================================== */
.celebration-mini-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08) !important;
}

.celebration-full-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06) !important;
}

.celebration-tab-btn {
  transition: all 0.2s ease;
}

.celebration-tab-btn:hover {
  opacity: 0.9;
}

/* ====================================================
   District Events & Meeting Calendar
   ==================================================== */
.calendar-event-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.calendar-event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08) !important;
  border-color: var(--primary-color) !important;
}

.cal-pill {
  transition: all 0.2s ease;
}

.cal-pill:hover {
  border-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
}

.cal-pill.active {
  background: var(--primary-color) !important;
  color: white !important;
  border-color: var(--primary-color) !important;
}

@media (max-width: 600px) {
  #club-officers-filter-ribbon {
    padding: 0.5rem 0.6rem !important;
    gap: 0.35rem !important;
    display: flex !important;
    flex-wrap: wrap !important;
  }
  .club-officer-title-select {
    font-size: 0.74rem !important;
    height: 36px !important;
  }
  .club-officer-filter-btn {
    font-size: 0.72rem !important;
    padding: 0.4rem 0.45rem !important;
    border-radius: 8px !important;
    gap: 0.25rem !important;
    width: auto !important;
  }
  .club-officer-filter-btn .filter-count-badge {
    font-size: 0.68rem !important;
    padding: 0.08rem 0.35rem !important;
  }
}

/* Dedicated Page Form Views (Zero Popup) */
.page-form-view-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  overflow: hidden;
  max-width: 860px;
  margin: 0 auto;
}

.page-form-header {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  padding: 1.25rem 1.75rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.responsive-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .responsive-form-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }
  .page-form-header {
    padding: 1rem 1.25rem !important;
  }
}

/* Parent District Static Badge when district selection is restricted */
.parent-district-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: 12px;
  border: 1.5px solid rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.06);
  color: var(--primary-color, #2563eb);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  box-sizing: border-box;
  transition: all 0.2s ease;
  user-select: none;
}
.parent-district-badge i,
.parent-district-badge svg {
  color: var(--primary-color, #2563eb);
  flex-shrink: 0;
}

/* ==========================================================================
   GLOBAL COMPLETE ELIMINATION OF MODAL / POPUP OVERLAYS
   ========================================================================== */
.modal:not(#modal-whatsapp-chooser):not(#modal-myclub-printable-doc):not(#select-club-modal):not(#modal-myclub-member-edit):not(#modal-myclub-feehead-edit):not(#modal-myclub-bill-create):not(#modal-myclub-receipt-create):not(#modal-myclub-voucher-create):not(#modal-myclub-bank-edit):not(#modal-club-dues):not(#modal-upload-to-international):not(#modal-set-goal-target):not(#modal-leadership-attendee-edit):not(#hierarchy-officer-popup-modal):not(#modal-district-pin-zoom):not(#modal-celebration-subscription):not(#modal-superadmin-grant-celebration):not(#modal-event-registration):not(#modal-event-reg-success):not(#modal-admin-event-roster):not(#lcif-add-modal):not(#lcif-import-modal):not(#modal-event-social-share):not(#modal-superadmin-add-officer):not(#modal-superadmin-add-mjf):not(#modal-superadmin-add-pdg),
.modal-overlay:not(#modal-whatsapp-chooser):not(#modal-myclub-printable-doc):not(#select-club-modal):not(#modal-myclub-member-edit):not(#modal-myclub-feehead-edit):not(#modal-myclub-bill-create):not(#modal-myclub-receipt-create):not(#modal-myclub-voucher-create):not(#modal-myclub-bank-edit):not(#modal-club-dues):not(#modal-upload-to-international):not(#modal-set-goal-target):not(#modal-leadership-attendee-edit):not(#hierarchy-officer-popup-modal):not(#modal-district-pin-zoom):not(#import-modal):not(#club-service-pst-modal):not(#role-assign-modal):not(#modal-celebration-subscription):not(#modal-superadmin-grant-celebration):not(#bulk-email-pending-modal):not(#bulk-email-progress-modal):not(#modal-event-registration):not(#modal-event-reg-success):not(#modal-admin-event-roster):not(#lcif-add-modal):not(#lcif-import-modal):not(#modal-event-social-share):not(#modal-superadmin-add-officer):not(#modal-superadmin-add-mjf):not(#modal-superadmin-add-pdg),
.sidebar-overlay,
#analytics-drilldown-modal,
.login-screen-overlay:not(#login-screen):not(#magic-update-screen):not(#access-restricted-screen):not(#role-assign-modal):not(#superadmin-member-modal):not(#superadmin-member-preview-modal):not(#contact-modal):not(#photo-modal):not(#link-modal):not(#lbn-sub-edit-modal):not(#email-action-modal):not(#bulk-email-pending-modal):not(#bulk-email-progress-modal) {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 10 !important;
  padding: 0.5rem 0 !important;
  margin: 0 auto !important;
  box-shadow: none !important;
  border: none !important;
  align-items: stretch !important;
  justify-content: center !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
  box-sizing: border-box !important;
}

.modal.active:not(#modal-whatsapp-chooser):not(#modal-myclub-printable-doc):not(#select-club-modal):not(#modal-myclub-member-edit):not(#modal-myclub-feehead-edit):not(#modal-myclub-bill-create):not(#modal-myclub-receipt-create):not(#modal-myclub-voucher-create):not(#modal-myclub-bank-edit):not(#modal-club-dues):not(#modal-upload-to-international):not(#modal-set-goal-target):not(#modal-leadership-attendee-edit):not(#hierarchy-officer-popup-modal):not(#modal-district-pin-zoom):not(#modal-celebration-subscription):not(#modal-superadmin-grant-celebration):not(#modal-event-registration):not(#modal-event-reg-success):not(#modal-admin-event-roster):not(#lcif-add-modal):not(#lcif-import-modal):not(#modal-event-social-share):not(#modal-superadmin-add-officer):not(#modal-superadmin-add-mjf):not(#modal-superadmin-add-pdg),
.modal[style*="display: flex"]:not(#modal-whatsapp-chooser):not(#modal-myclub-printable-doc):not(#select-club-modal):not(#modal-myclub-member-edit):not(#modal-myclub-feehead-edit):not(#modal-myclub-bill-create):not(#modal-myclub-receipt-create):not(#modal-myclub-voucher-create):not(#modal-myclub-bank-edit):not(#modal-club-dues):not(#modal-upload-to-international):not(#modal-set-goal-target):not(#modal-leadership-attendee-edit):not(#hierarchy-officer-popup-modal):not(#modal-district-pin-zoom):not(#modal-celebration-subscription):not(#modal-superadmin-grant-celebration):not(#modal-event-registration):not(#modal-event-reg-success):not(#modal-admin-event-roster):not(#lcif-add-modal):not(#lcif-import-modal):not(#modal-event-social-share):not(#modal-superadmin-add-officer):not(#modal-superadmin-add-mjf):not(#modal-superadmin-add-pdg),
.modal[style*="display: block"]:not(#modal-whatsapp-chooser):not(#modal-myclub-printable-doc):not(#select-club-modal):not(#modal-myclub-member-edit):not(#modal-myclub-feehead-edit):not(#modal-myclub-bill-create):not(#modal-myclub-receipt-create):not(#modal-myclub-voucher-create):not(#modal-myclub-bank-edit):not(#modal-club-dues):not(#modal-upload-to-international):not(#modal-set-goal-target):not(#modal-leadership-attendee-edit):not(#hierarchy-officer-popup-modal):not(#modal-district-pin-zoom):not(#modal-celebration-subscription):not(#modal-superadmin-grant-celebration):not(#modal-event-registration):not(#modal-event-reg-success):not(#modal-admin-event-roster):not(#lcif-add-modal):not(#lcif-import-modal):not(#modal-event-social-share):not(#modal-superadmin-add-officer):not(#modal-superadmin-add-mjf):not(#modal-superadmin-add-pdg),
.modal-overlay.active:not(#modal-whatsapp-chooser):not(#modal-myclub-printable-doc):not(#select-club-modal):not(#modal-myclub-member-edit):not(#modal-myclub-feehead-edit):not(#modal-myclub-bill-create):not(#modal-myclub-receipt-create):not(#modal-myclub-voucher-create):not(#modal-myclub-bank-edit):not(#modal-club-dues):not(#modal-upload-to-international):not(#modal-set-goal-target):not(#modal-leadership-attendee-edit):not(#hierarchy-officer-popup-modal):not(#modal-district-pin-zoom):not(#import-modal):not(#club-service-pst-modal):not(#role-assign-modal):not(#modal-celebration-subscription):not(#modal-superadmin-grant-celebration):not(#bulk-email-pending-modal):not(#bulk-email-progress-modal):not(#modal-event-registration):not(#modal-event-reg-success):not(#modal-admin-event-roster):not(#lcif-add-modal):not(#lcif-import-modal):not(#modal-event-social-share):not(#modal-superadmin-add-officer):not(#modal-superadmin-add-mjf):not(#modal-superadmin-add-pdg),
.modal-overlay[style*="display: flex"]:not(#modal-whatsapp-chooser):not(#modal-myclub-printable-doc):not(#select-club-modal):not(#modal-myclub-member-edit):not(#modal-myclub-feehead-edit):not(#modal-myclub-bill-create):not(#modal-myclub-receipt-create):not(#modal-myclub-voucher-create):not(#modal-myclub-bank-edit):not(#modal-club-dues):not(#modal-upload-to-international):not(#modal-set-goal-target):not(#modal-leadership-attendee-edit):not(#hierarchy-officer-popup-modal):not(#modal-district-pin-zoom):not(#import-modal):not(#club-service-pst-modal):not(#role-assign-modal):not(#modal-celebration-subscription):not(#modal-superadmin-grant-celebration):not(#bulk-email-pending-modal):not(#bulk-email-progress-modal):not(#modal-event-registration):not(#modal-event-reg-success):not(#modal-admin-event-roster):not(#lcif-add-modal):not(#lcif-import-modal):not(#modal-event-social-share):not(#modal-superadmin-add-officer):not(#modal-superadmin-add-mjf):not(#modal-superadmin-add-pdg),
.modal-overlay[style*="display: block"]:not(#modal-whatsapp-chooser):not(#modal-myclub-printable-doc):not(#select-club-modal):not(#modal-myclub-member-edit):not(#modal-myclub-feehead-edit):not(#modal-myclub-bill-create):not(#modal-myclub-receipt-create):not(#modal-myclub-voucher-create):not(#modal-myclub-bank-edit):not(#modal-club-dues):not(#modal-upload-to-international):not(#modal-set-goal-target):not(#modal-leadership-attendee-edit):not(#hierarchy-officer-popup-modal):not(#modal-district-pin-zoom):not(#import-modal):not(#club-service-pst-modal):not(#role-assign-modal):not(#modal-celebration-subscription):not(#modal-superadmin-grant-celebration):not(#bulk-email-pending-modal):not(#bulk-email-progress-modal):not(#modal-event-registration):not(#modal-event-reg-success):not(#modal-admin-event-roster):not(#lcif-add-modal):not(#lcif-import-modal):not(#modal-event-social-share):not(#modal-superadmin-add-officer):not(#modal-superadmin-add-mjf):not(#modal-superadmin-add-pdg),
.sidebar-overlay.active,
.sidebar-overlay[style*="display: flex"],
.sidebar-overlay[style*="display: block"],
#analytics-drilldown-modal[style*="display: flex"],
#analytics-drilldown-modal[style*="display: block"],
.login-screen-overlay.active:not(#login-screen):not(#magic-update-screen):not(#access-restricted-screen):not(#role-assign-modal):not(#superadmin-member-modal):not(#superadmin-member-preview-modal):not(#contact-modal):not(#photo-modal):not(#link-modal):not(#lbn-sub-edit-modal):not(#email-action-modal):not(#bulk-email-pending-modal):not(#bulk-email-progress-modal),
.login-screen-overlay[style*="display: flex"]:not(#login-screen):not(#magic-update-screen):not(#access-restricted-screen):not(#role-assign-modal):not(#superadmin-member-modal):not(#superadmin-member-preview-modal):not(#contact-modal):not(#photo-modal):not(#link-modal):not(#lbn-sub-edit-modal):not(#email-action-modal):not(#bulk-email-pending-modal):not(#bulk-email-progress-modal),
.login-screen-overlay[style*="display: block"]:not(#login-screen):not(#magic-update-screen):not(#access-restricted-screen):not(#role-assign-modal):not(#superadmin-member-modal):not(#superadmin-member-preview-modal):not(#contact-modal):not(#photo-modal):not(#link-modal):not(#lbn-sub-edit-modal):not(#email-action-modal):not(#bulk-email-pending-modal):not(#bulk-email-progress-modal) {
  display: block !important;
}

.modal-content:not(#modal-myclub-printable-doc .modal-content):not(#select-club-modal *):not(#modal-myclub-member-edit *):not(#modal-myclub-feehead-edit *):not(#modal-myclub-bill-create *):not(#modal-myclub-receipt-create *):not(#modal-myclub-voucher-create *):not(#modal-myclub-bank-edit *):not(#modal-club-dues *):not(#modal-set-goal-target .modal-content):not(#modal-leadership-attendee-edit .modal-content):not(#import-modal .modal-content):not(#modal-celebration-subscription .modal-content):not(#modal-superadmin-grant-celebration .modal-content):not(#modal-celebration-subscription .modal-card):not(#modal-superadmin-grant-celebration .modal-card):not(#modal-event-registration .modal-content):not(#modal-event-reg-success .modal-content):not(#modal-admin-event-roster .modal-content):not(#lcif-add-modal .modal-content):not(#lcif-import-modal .modal-content):not(#lcif-add-modal .modal-card):not(#lcif-import-modal .modal-card):not(#lcif-club-donors-modal .modal-card):not(#lcif-club-donors-modal .modal-content):not(#modal-event-social-share .modal-content):not(#modal-superadmin-add-officer .modal-content):not(#modal-superadmin-add-officer):not(#modal-superadmin-add-mjf .modal-content):not(#modal-superadmin-add-mjf):not(#modal-superadmin-add-pdg .modal-content):not(#modal-superadmin-add-pdg),
.modal-card:not(#modal-myclub-printable-doc .modal-content):not(#select-club-modal *):not(#modal-myclub-member-edit *):not(#modal-myclub-feehead-edit *):not(#modal-myclub-bill-create *):not(#modal-myclub-receipt-create *):not(#modal-myclub-voucher-create *):not(#modal-myclub-bank-edit *):not(#modal-club-dues *):not(#modal-set-goal-target .modal-card):not(#modal-leadership-attendee-edit .modal-card):not(#modal-set-goal-target):not(#modal-leadership-attendee-edit):not(#hierarchy-officer-popup-modal .modal-card):not(#hierarchy-officer-popup-modal):not(#modal-district-pin-zoom .modal-district-pin-card):not(#modal-district-pin-zoom):not(#club-service-pst-modal .modal-card):not(#import-modal .modal-card):not(#modal-celebration-subscription .modal-card):not(#modal-superadmin-grant-celebration .modal-card):not(#modal-event-registration .modal-card):not(#modal-event-reg-success .modal-card):not(#modal-admin-event-roster .modal-card):not(#lcif-add-modal .modal-card):not(#lcif-import-modal .modal-card):not(#lcif-add-modal .modal-content):not(#lcif-import-modal .modal-content):not(#lcif-club-donors-modal .modal-card):not(#lcif-club-donors-modal .modal-content):not(#modal-event-social-share .modal-card):not(#modal-superadmin-add-officer .modal-card):not(#modal-superadmin-add-officer):not(#modal-superadmin-add-mjf .modal-card):not(#modal-superadmin-add-mjf):not(#modal-superadmin-add-pdg .modal-card):not(#modal-superadmin-add-pdg),
.profile-sidebar,
#analytics-drilldown-modal > div,
.login-screen-overlay:not(#login-screen):not(#magic-update-screen):not(#access-restricted-screen):not(#role-assign-modal):not(#superadmin-member-modal):not(#superadmin-member-preview-modal):not(#contact-modal):not(#photo-modal):not(#link-modal):not(#lbn-sub-edit-modal):not(#email-action-modal):not(#bulk-email-pending-modal):not(#bulk-email-progress-modal) .login-card {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: 100% !important;
  max-width: 920px !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  margin: 1rem auto 2.5rem auto !important;
  background-color: var(--card-bg, #ffffff) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: var(--radius-xl, 16px) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06) !important;
  transform: none !important;
  opacity: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

/* Wide format for tables, drilldowns, printables and document readers */
#superadmin-member-modal .login-card,
#superadmin-member-preview-modal .login-card,
#admin-profile-requests-modal .modal-card,
#modal-myclub-printable-doc .modal-content,
#broadcast-reader-modal .modal-content,
#vault-preview-modal .modal-card,
#celebrations-modal .modal-content,
#modal-myclub-bill-create .modal-content,
#modal-myclub-receipt-create .modal-content,
#modal-myclub-voucher-create .modal-content,
.sidebar-overlay .profile-sidebar {
  max-width: 1020px !important;
}

/* Extra Wide & High-Performance Format for Analytics Drilldown */
#analytics-drilldown-modal > div {
  max-width: 1260px !important;
  width: 100% !important;
}

#drilldown-table {
  width: 100% !important;
  min-width: 1060px !important;
  border-collapse: collapse !important;
  table-layout: auto !important;
}

#drilldown-table th,
#drilldown-table td {
  vertical-align: middle !important;
}

#drilldown-cards-wrap .analytics-drilldown-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: all 0.15s ease;
  box-sizing: border-box;
}

#drilldown-cards-wrap .analytics-drilldown-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.06);
}

/* Natural height for modal bodies - eliminates trapped inner scrollbars */
.modal-body,
.sidebar-content,
.modal-content > div[style*="overflow-y"],
.modal-card > div[style*="overflow-y"],
.login-card > div[style*="overflow-y"],
#celebrations-modal-body,
#club-officers-modal-body,
#reader-circular-body,
#vault-reader-content,
#drilldown-table-wrap {
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
}

/* Header styling for inline modal view cards */
.modal-header,
.sidebar-header {
  padding: 1.25rem 1.5rem !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-bottom: 1px solid var(--border-color) !important;
  flex-wrap: wrap !important;
  gap: 0.75rem !important;
}

/* Prominent back button in inline headers */
.inline-back-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  padding: 0.5rem 1rem !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  border: 1px solid var(--border-color, #cbd5e1) !important;
  background: var(--btn-secondary-bg, #f1f5f9) !important;
  color: var(--text-color, #1e293b) !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
}

.inline-back-btn:hover {
  background: var(--border-color, #e2e8f0) !important;
  transform: translateY(-1px) !important;
}

@media (max-width: 640px) {
  .modal-content:not(#modal-event-registration .modal-content):not(#modal-event-reg-success .modal-content),
  .modal-card:not(#modal-event-registration .modal-card):not(#modal-event-reg-success .modal-card),
  .profile-sidebar,
  #analytics-drilldown-modal > div,
  .login-screen-overlay:not(#login-screen):not(#magic-update-screen):not(#access-restricted-screen) .login-card {
    border-radius: var(--radius-md, 10px) !important;
    margin: 0.5rem auto 1.5rem auto !important;
    max-width: 100% !important;
    padding: 1rem !important;
  }
}


/* Ensure proper hidden state when closed or display: none */
.modal[style*="display: none"],
.modal-overlay[style*="display: none"],
.sidebar-overlay[style*="display: none"],
#analytics-drilldown-modal[style*="display: none"],
.modal:not(.active):not([style*="display: block"]):not([style*="display: flex"]),
.modal-overlay:not(.active):not([style*="display: block"]):not([style*="display: flex"]),
.sidebar-overlay:not(.active):not([style*="display: block"]):not([style*="display: flex"]),
#analytics-drilldown-modal:not(.active):not([style*="display: block"]):not([style*="display: flex"]) {
  display: none !important;
}

/* ==========================================================================
   SETTINGS & PROFILE DRAWER (FIXED MODAL OVERLAY)
   ========================================================================== */
#settings-drawer-overlay,
.app-drawer-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  z-index: 99999 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
}

#settings-drawer-overlay.open,
#settings-drawer-overlay[style*="display: block"],
#settings-drawer-overlay[style*="display: flex"] {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

#settings-drawer-overlay[style*="display: none"],
#settings-drawer-overlay:not(.open):not([style*="display: flex"]):not([style*="display: block"]) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

#app-settings-drawer,
.app-drawer {
  position: relative !important;
  width: 100% !important;
  max-width: 480px !important;
  max-height: 88vh !important;
  background: var(--card-bg, #ffffff) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: var(--radius-xl, 20px) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35) !important;
  z-index: 100000 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  margin: auto !important;
  transform: none !important;
  opacity: 1 !important;
}

#app-settings-drawer > div:nth-child(2) {
  overflow-y: auto !important;
  max-height: calc(88vh - 70px) !important;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  #app-settings-drawer,
  .app-drawer {
    max-width: 100% !important;
    max-height: 92vh !important;
    border-radius: 16px !important;
    margin: auto !important;
  }
}

/* Profile Photo & Contact Update Modal */
#profile-update-modal {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  z-index: 100010 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
}

#profile-update-modal.active,
#profile-update-modal[style*="display: flex"],
#profile-update-modal[style*="display: block"] {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

#profile-update-modal[style*="display: none"],
#profile-update-modal:not(.active):not([style*="display: flex"]):not([style*="display: block"]) {
  display: none !important;
}

#profile-update-modal .modal-card {
  position: relative !important;
  width: 100% !important;
  max-width: 520px !important;
  max-height: 90vh !important;
  background: var(--card-bg, #ffffff) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: var(--radius-xl, 20px) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35) !important;
  z-index: 100011 !important;
  overflow-y: auto !important;
  margin: auto !important;
}

/* Excel Import Modal Overlay */
/* Excel Import Modal Overlay */
#import-modal,
div#import-modal.modal-overlay,
div#import-modal.fixed-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  z-index: 100020 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
}

#import-modal.active,
div#import-modal.modal-overlay.active,
div#import-modal.fixed-modal-overlay.active,
#import-modal[style*="display: flex"],
div#import-modal.modal-overlay[style*="display: flex"],
div#import-modal.fixed-modal-overlay[style*="display: flex"],
#import-modal[style*="display: block"],
div#import-modal.modal-overlay[style*="display: block"],
div#import-modal.fixed-modal-overlay[style*="display: block"] {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#import-modal[style*="display: none"],
div#import-modal.modal-overlay[style*="display: none"],
div#import-modal.fixed-modal-overlay[style*="display: none"],
#import-modal:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
div#import-modal.modal-overlay:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
div#import-modal.fixed-modal-overlay:not(.active):not([style*="display: flex"]):not([style*="display: block"]) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#import-modal .modal-content,
div#import-modal .modal-content {
  position: relative !important;
  width: 100% !important;
  max-width: 620px !important;
  max-height: 90vh !important;
  background: var(--card-bg, #ffffff) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: var(--radius-xl, 20px) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35) !important;
  z-index: 100021 !important;
  overflow: hidden !important;
  margin: auto !important;
  display: flex !important;
  flex-direction: column !important;
  transform: none !important;
}

#import-modal .modal-header,
div#import-modal .modal-header {
  padding: 1.25rem 1.5rem !important;
  border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}

#import-modal .modal-body,
div#import-modal .modal-body {
  overflow-y: auto !important;
  max-height: calc(90vh - 140px) !important;
  padding: 1.25rem 1.5rem !important;
  flex-grow: 1 !important;
}

#import-modal .modal-footer,
div#import-modal .modal-footer {
  padding: 1rem 1.5rem !important;
  border-top: 1px solid var(--border-color, #e2e8f0) !important;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 0.75rem !important;
  flex-shrink: 0 !important;
}

/* =========================================================
   Club Service Impact & PST Details Modal Overlay (Fixed Pop-up)
   ========================================================= */
#club-service-pst-modal,
div#club-service-pst-modal.modal-overlay,
div#club-service-pst-modal.fixed-modal-overlay,
#modal-superadmin-add-officer,
div#modal-superadmin-add-officer.modal-overlay,
div#modal-superadmin-add-officer.fixed-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  z-index: 100030 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
}

#club-service-pst-modal.active,
div#club-service-pst-modal.modal-overlay.active,
div#club-service-pst-modal.fixed-modal-overlay.active,
#club-service-pst-modal[style*="display: flex"],
div#club-service-pst-modal.modal-overlay[style*="display: flex"],
div#club-service-pst-modal.fixed-modal-overlay[style*="display: flex"],
#club-service-pst-modal[style*="display: block"],
div#club-service-pst-modal.modal-overlay[style*="display: block"],
div#club-service-pst-modal.fixed-modal-overlay[style*="display: block"],
#modal-superadmin-add-officer.active,
div#modal-superadmin-add-officer.modal-overlay.active,
div#modal-superadmin-add-officer.fixed-modal-overlay.active,
#modal-superadmin-add-officer[style*="display: flex"],
div#modal-superadmin-add-officer.modal-overlay[style*="display: flex"],
div#modal-superadmin-add-officer.fixed-modal-overlay[style*="display: flex"],
#modal-superadmin-add-officer[style*="display: block"],
div#modal-superadmin-add-officer.modal-overlay[style*="display: block"],
div#modal-superadmin-add-officer.fixed-modal-overlay[style*="display: block"] {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#club-service-pst-modal[style*="display: none"],
div#club-service-pst-modal.modal-overlay[style*="display: none"],
div#club-service-pst-modal.fixed-modal-overlay[style*="display: none"],
#club-service-pst-modal:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
div#club-service-pst-modal.modal-overlay:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
div#club-service-pst-modal.fixed-modal-overlay:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
#modal-superadmin-add-officer[style*="display: none"],
div#modal-superadmin-add-officer.modal-overlay[style*="display: none"],
div#modal-superadmin-add-officer.fixed-modal-overlay[style*="display: none"],
#modal-superadmin-add-officer:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
div#modal-superadmin-add-officer.modal-overlay:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
div#modal-superadmin-add-officer.fixed-modal-overlay:not(.active):not([style*="display: flex"]):not([style*="display: block"]) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#club-service-pst-modal .modal-card,
div#club-service-pst-modal .modal-card {
  position: relative !important;
  width: 100% !important;
  max-width: 820px !important;
  max-height: 92vh !important;
  background: var(--card-bg, #ffffff) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: var(--radius-xl, 20px) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4) !important;
  z-index: 100031 !important;
  overflow: hidden !important;
  margin: auto !important;
  display: flex !important;
  flex-direction: column !important;
  transform: none !important;
}

#modal-superadmin-add-officer.fixed-modal-overlay,
div#modal-superadmin-add-officer.fixed-modal-overlay {
  overflow-y: auto !important;
  padding: 1rem !important;
}

#modal-superadmin-add-officer .modal-card,
div#modal-superadmin-add-officer .modal-card {
  position: relative !important;
  width: 100% !important;
  max-width: 840px !important;
  max-height: min(88vh, calc(100dvh - 2rem)) !important;
  height: min(88vh, calc(100dvh - 2rem)) !important;
  background: var(--card-bg, #ffffff) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: var(--radius-xl, 18px) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4) !important;
  z-index: 100031 !important;
  overflow: hidden !important;
  margin: auto !important;
  display: flex !important;
  flex-direction: column !important;
  transform: none !important;
}

#modal-superadmin-add-officer #form-superadmin-add-officer,
div#modal-superadmin-add-officer #form-superadmin-add-officer {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
  box-sizing: border-box !important;
  padding: 1.15rem 1.5rem !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1.15rem !important;
  margin: 0 !important;
}

#modal-superadmin-add-officer .modal-footer,
div#modal-superadmin-add-officer .modal-footer,
#modal-superadmin-add-officer .modal-card > div.modal-footer {
  flex-shrink: 0 !important;
  position: sticky !important;
  bottom: 0 !important;
  margin-top: auto !important;
  background: var(--card-bg, #ffffff) !important;
  border-top: 1.5px solid var(--border-color, #e2e8f0) !important;
  padding: 0.85rem 1.5rem !important;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 0.75rem !important;
  z-index: 20 !important;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.05) !important;
}

#modal-superadmin-add-mjf .modal-card,
div#modal-superadmin-add-mjf .modal-card,
#modal-superadmin-add-pdg .modal-card,
div#modal-superadmin-add-pdg .modal-card {
  position: relative !important;
  width: 100% !important;
  max-width: 680px !important;
  max-height: min(90vh, calc(100dvh - 2rem)) !important;
  height: min(90vh, calc(100dvh - 2rem)) !important;
  background: var(--card-bg, #ffffff) !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4) !important;
  border: 1px solid var(--border-color) !important;
  margin: auto !important;
  display: flex !important;
  flex-direction: column !important;
}

#modal-superadmin-add-mjf form,
#modal-superadmin-add-pdg form {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

#modal-superadmin-add-mjf .modal-card > div:last-child,
#modal-superadmin-add-pdg .modal-card > div:last-child {
  flex-shrink: 0 !important;
  position: sticky !important;
  bottom: 0 !important;
  margin-top: auto !important;
  z-index: 20 !important;
}

#club-service-pst-modal #csp-officers-list,
div#club-service-pst-modal #csp-officers-list {
  overflow-y: auto !important;
  max-height: 52vh !important;
  -webkit-overflow-scrolling: touch;
}

/* =========================================================
   District Leadership Officer Details Popup Modal (True Fixed Pop-up)
   ========================================================= */
#hierarchy-officer-popup-modal,
div#hierarchy-officer-popup-modal.modal-overlay,
div#hierarchy-officer-popup-modal.fixed-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.78) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 200150 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
}

#hierarchy-officer-popup-modal.active,
div#hierarchy-officer-popup-modal.active,
#hierarchy-officer-popup-modal[style*="display: flex"],
div#hierarchy-officer-popup-modal[style*="display: flex"],
#hierarchy-officer-popup-modal[style*="display: block"],
div#hierarchy-officer-popup-modal[style*="display: block"] {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#hierarchy-officer-popup-modal[style*="display: none"],
div#hierarchy-officer-popup-modal[style*="display: none"],
#hierarchy-officer-popup-modal:not(.active):not([style*="display: flex"]):not([style*="display: block"]) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#hierarchy-officer-popup-modal .modal-card,
div#hierarchy-officer-popup-modal .modal-card,
#hierarchy-officer-popup-modal .hierarchy-officer-modal-card {
  position: relative !important;
  width: 100% !important;
  max-width: 660px !important;
  max-height: 92vh !important;
  background: var(--card-bg, #ffffff) !important;
  border-radius: 20px !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  margin: auto !important;
  animation: goalsPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#hierarchy-officer-popup-modal .modal-body-scroll {
  overflow-y: auto !important;
  max-height: calc(92vh - 145px) !important;
  -webkit-overflow-scrolling: touch !important;
}

/* =========================================================
   Goal Setting Target Modal Overlay (True Fixed Pop-up)
   ========================================================= */
#modal-set-goal-target,
div#modal-set-goal-target.modal-overlay,
div#modal-set-goal-target.goals-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 100050 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
}

#modal-set-goal-target.active,
div#modal-set-goal-target.active,
#modal-set-goal-target[style*="display: flex"],
div#modal-set-goal-target[style*="display: flex"],
#modal-set-goal-target[style*="display: block"],
div#modal-set-goal-target[style*="display: block"] {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#modal-set-goal-target[style*="display: none"],
div#modal-set-goal-target[style*="display: none"],
#modal-set-goal-target:not(.active):not([style*="display: flex"]):not([style*="display: block"]) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#modal-set-goal-target .modal-card,
div#modal-set-goal-target .modal-card,
#modal-set-goal-target .goals-modal-card {
  position: relative !important;
  width: 100% !important;
  max-width: 560px !important;
  max-height: 92vh !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15) !important;
  z-index: 100051 !important;
  overflow: hidden !important;
  margin: auto !important;
  display: flex !important;
  flex-direction: column !important;
  animation: goalsPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#modal-set-goal-target form {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  max-height: calc(92vh - 120px) !important;
}

/* =========================================================
   Leadership Attendee Modal (Fixed True Floating Pop-up)
   ========================================================= */
#modal-leadership-attendee-edit,
div#modal-leadership-attendee-edit.modal-overlay,
div#modal-leadership-attendee-edit.leadership-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.78) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 200080 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
}

#modal-leadership-attendee-edit.active,
div#modal-leadership-attendee-edit.active,
#modal-leadership-attendee-edit[style*="display: flex"],
div#modal-leadership-attendee-edit[style*="display: flex"],
#modal-leadership-attendee-edit[style*="display: block"],
div#modal-leadership-attendee-edit[style*="display: block"] {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#modal-leadership-attendee-edit[style*="display: none"],
div#modal-leadership-attendee-edit[style*="display: none"],
#modal-leadership-attendee-edit:not(.active):not([style*="display: flex"]):not([style*="display: block"]) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#modal-leadership-attendee-edit .modal-card,
div#modal-leadership-attendee-edit .modal-card,
#modal-leadership-attendee-edit .leadership-modal-card {
  position: relative !important;
  width: 100% !important;
  max-width: 640px !important;
  max-height: 92vh !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15) !important;
  z-index: 200081 !important;
  overflow: hidden !important;
  margin: auto !important;
  display: flex !important;
  flex-direction: column !important;
  animation: goalsPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#modal-leadership-attendee-edit form {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  max-height: calc(92vh - 100px) !important;
}

/* =========================================================
   Admin Event Roster Modal (Fixed True Pop-up)
   ========================================================= */
#modal-admin-event-roster,
div#modal-admin-event-roster {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.72) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  z-index: 100050 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
}

#modal-admin-event-roster.active,
#modal-admin-event-roster[style*="display: flex"],
#modal-admin-event-roster[style*="display: block"],
div#modal-admin-event-roster.active,
div#modal-admin-event-roster[style*="display: flex"],
div#modal-admin-event-roster[style*="display: block"] {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#modal-admin-event-roster[style*="display: none"],
#modal-admin-event-roster:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
div#modal-admin-event-roster[style*="display: none"],
div#modal-admin-event-roster:not(.active):not([style*="display: flex"]):not([style*="display: block"]) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#modal-admin-event-roster .modal-content,
div#modal-admin-event-roster .modal-content {
  position: relative !important;
  width: 100% !important;
  max-width: 980px !important;
  height: 92vh !important;
  max-height: 92vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  background: var(--card-bg, #ffffff) !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.45) !important;
  border: 1px solid var(--border-color, #cbd5e1) !important;
  margin: auto !important;
  z-index: 100051 !important;
  animation: modalPopupZoomIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

#modal-admin-event-roster .admin-roster-table-wrapper,
#admin-roster-table-scroll {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  background: var(--card-bg, #ffffff) !important;
  overscroll-behavior: contain !important;
}

#admin-roster-table-scroll table {
  min-width: 620px !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

#admin-roster-table-scroll thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  background: var(--bg-hover, #f8fafc) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

.admin-roster-stat-card {
  cursor: pointer !important;
  user-select: none !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative !important;
}

.admin-roster-stat-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
  filter: brightness(0.98) !important;
}

.admin-roster-stat-card.stat-card-active {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  transform: translateY(-1px) !important;
}

@media (max-width: 768px) {
  #modal-admin-event-roster,
  div#modal-admin-event-roster {
    padding: 0.35rem !important;
    align-items: center !important;
  }

  #modal-admin-event-roster .modal-content,
  div#modal-admin-event-roster .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 96vh !important;
    height: 96dvh !important;
    max-height: 96dvh !important;
    border-radius: 12px !important;
  }

  #modal-admin-event-roster .admin-roster-header {
    padding: 0.6rem 0.85rem !important;
  }

  #modal-admin-event-roster .admin-roster-header h3 {
    font-size: 0.95rem !important;
  }

  #modal-admin-event-roster .admin-roster-header p {
    display: none !important;
  }

  #modal-admin-event-roster .admin-roster-controls {
    padding: 0.5rem 0.75rem !important;
    gap: 0.45rem !important;
  }

  #modal-admin-event-roster .admin-roster-controls select {
    font-size: 0.8rem !important;
    padding: 0.35rem 0.5rem !important;
  }

  #modal-admin-event-roster .admin-roster-actions {
    gap: 0.35rem !important;
  }

  #modal-admin-event-roster .admin-roster-actions .btn {
    font-size: 0.72rem !important;
    padding: 0.3rem 0.55rem !important;
  }

  #modal-admin-event-roster .admin-roster-stats-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 0.25rem !important;
  }

  #modal-admin-event-roster .admin-roster-stat-card {
    padding: 0.3rem 0.25rem !important;
    text-align: center !important;
  }

  #modal-admin-event-roster .admin-roster-stat-card .stat-label {
    font-size: 0.54rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    letter-spacing: -0.02em !important;
  }

  #modal-admin-event-roster .admin-roster-stat-card .stat-val {
    font-size: 0.85rem !important;
    margin-top: 0.1rem !important;
  }

  #modal-admin-event-roster #admin-roster-stat-paid-count {
    font-size: 0.58rem !important;
    padding: 0 2px !important;
  }

  #modal-admin-event-roster input#admin-roster-search-input {
    padding: 0.38rem 0.65rem !important;
    font-size: 0.8rem !important;
  }
}

/* =========================================================
   Event Roster PDF Options Modal
   ========================================================= */
.admin-roster-pdf-modal-overlay,
#modal-admin-roster-pdf-options,
div#modal-admin-roster-pdf-options {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: rgba(15, 23, 42, 0.78) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  z-index: 100060 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
}

.admin-roster-pdf-modal-overlay.active,
#modal-admin-roster-pdf-options.active,
#modal-admin-roster-pdf-options[style*="display: flex"],
div#modal-admin-roster-pdf-options.active,
div#modal-admin-roster-pdf-options[style*="display: flex"] {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.admin-roster-pdf-modal-overlay:not(.active):not([style*="display: flex"]),
#modal-admin-roster-pdf-options:not(.active):not([style*="display: flex"]) {
  display: none;
}

#modal-admin-roster-pdf-options .modal-content,
div#modal-admin-roster-pdf-options .modal-content {
  position: relative !important;
  width: 100% !important;
  max-width: 580px !important;
  max-height: 90vh !important;
  background: var(--card-bg, #ffffff) !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.45) !important;
  border: 1px solid var(--border-color, #cbd5e1) !important;
  margin: auto !important;
  z-index: 100061 !important;
  animation: modalPopupZoomIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

.roster-pdf-opt-label:hover {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.04) !important;
}

.roster-pdf-opt-label:has(input:checked) {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  box-shadow: 0 0 0 1px #ef4444 !important;
}

@keyframes modalPopupZoomIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* =========================================================
   Celebration Subscription & Event Registration Modals
   (Full-Window Screen View with Smooth Scrolling)
   ========================================================= */
#modal-celebration-subscription,
#modal-superadmin-grant-celebration,
div#modal-celebration-subscription,
div#modal-superadmin-grant-celebration,
#modal-event-registration,
div#modal-event-registration,
.event-reg-fullscreen-overlay,
#modal-event-reg-success,
div#modal-event-reg-success {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: 100vw !important;
  max-height: 100dvh !important;
  background: var(--bg-color, #f8fafc) !important;
  z-index: 100050 !important;
  display: none !important;
  flex-direction: column !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
}

#modal-celebration-subscription.active,
#modal-celebration-subscription[style*="display: flex"],
#modal-celebration-subscription[style*="display: block"],
#modal-superadmin-grant-celebration.active,
#modal-superadmin-grant-celebration[style*="display: flex"],
#modal-superadmin-grant-celebration[style*="display: block"],
#modal-event-registration.active,
#modal-event-registration[style*="display: flex"],
#modal-event-registration[style*="display: block"],
div#modal-event-registration.active,
div#modal-event-registration[style*="display: flex"],
div#modal-event-registration[style*="display: block"],
.event-reg-fullscreen-overlay.active,
.event-reg-fullscreen-overlay[style*="display: flex"],
.event-reg-fullscreen-overlay[style*="display: block"],
#modal-event-reg-success.active,
#modal-event-reg-success[style*="display: flex"],
#modal-event-reg-success[style*="display: block"],
div#modal-event-reg-success.active,
div#modal-event-reg-success[style*="display: flex"],
div#modal-event-reg-success[style*="display: block"] {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#modal-celebration-subscription[style*="display: none"],
#modal-celebration-subscription:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
#modal-superadmin-grant-celebration[style*="display: none"],
#modal-superadmin-grant-celebration:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
#modal-event-registration[style*="display: none"],
#modal-event-registration:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
div#modal-event-registration[style*="display: none"],
div#modal-event-registration:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
.event-reg-fullscreen-overlay[style*="display: none"],
.event-reg-fullscreen-overlay:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
#modal-event-reg-success[style*="display: none"],
#modal-event-reg-success:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
div#modal-event-reg-success[style*="display: none"],
div#modal-event-reg-success:not(.active):not([style*="display: flex"]):not([style*="display: block"]) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#modal-celebration-subscription .modal-content,
#modal-celebration-subscription .modal-card,
#modal-superadmin-grant-celebration .modal-content,
#modal-superadmin-grant-celebration .modal-card,
#modal-event-registration .modal-content,
#modal-event-registration .modal-card,
#modal-event-registration .event-reg-fullscreen-container,
#modal-event-registration > div,
.event-reg-fullscreen-container,
#modal-event-reg-success .modal-content,
#modal-event-reg-success .modal-card {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 100% !important;
  height: auto !important;
  max-height: none !important;
  background: var(--bg-color, #f8fafc) !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  z-index: 100051 !important;
  overflow: visible !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  transform: none !important;
  box-sizing: border-box !important;
}

/* Event Registration Form - Clean Page-Level Responsive Styling */
#modal-event-registration .reg-modal-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 100055 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

#modal-event-registration .reg-type-tabs {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  padding: 6px !important;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
}

#modal-event-registration #reg-type-member-btn,
#modal-event-registration #reg-type-guest-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.65rem 0.5rem !important;
  gap: 0.35rem !important;
  text-align: center !important;
  min-height: 56px !important;
  border-radius: 8px !important;
}

#modal-event-registration #reg-type-member-btn > span:first-child,
#modal-event-registration #reg-type-guest-btn > span:first-child {
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
}

#modal-event-registration #reg-type-member-badge,
#modal-event-registration #reg-type-guest-badge {
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  padding: 2px 10px !important;
  border-radius: 9999px !important;
  line-height: 1.2 !important;
  min-width: 48px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#modal-event-registration input[type="text"],
#modal-event-registration input[type="tel"],
#modal-event-registration input[type="email"],
#modal-event-registration select,
#reg-lookup-input,
#reg-payment-utr {
  font-size: 16px !important;
}

@media (max-width: 640px) {
  #modal-event-registration .reg-modal-header {
    padding: 0.85rem 1rem !important;
  }

  #modal-event-registration .reg-modal-header #reg-modal-event-title {
    font-size: 1.12rem !important;
    line-height: 1.25 !important;
  }

  #modal-event-registration .reg-modal-header #reg-modal-event-meta {
    font-size: 0.8rem !important;
  }

  #modal-event-registration #reg-member-details-grid,
  #modal-event-registration .reg-member-details-grid {
    grid-template-columns: 1fr !important;
    padding: 0.85rem 1rem !important;
    row-gap: 0.75rem !important;
    column-gap: 0 !important;
  }

  #modal-event-registration #reg-member-details-grid > div > div:first-child {
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
  }

  #modal-event-registration #reg-member-details-grid > div > div:last-child {
    font-size: 0.98rem !important;
    font-weight: 800 !important;
    margin-top: 0.15rem !important;
    word-break: break-word !important;
  }

  #modal-event-registration .responsive-form-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  #modal-event-registration .responsive-form-grid > div {
    grid-column: span 1 !important;
  }

  #modal-event-registration #reg-upi-payment-section {
    padding: 0.85rem !important;
    gap: 0.75rem !important;
  }

  #modal-event-registration #reg-upi-qr-img {
    width: 155px !important;
    height: 155px !important;
  }

  #modal-event-registration #reg-upi-intent-link {
    display: flex !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.85rem 1rem !important;
    font-size: 0.92rem !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 48px !important;
  }

  #modal-event-registration #reg-submit-btn {
    min-height: 50px !important;
    font-size: 1.05rem !important;
    padding: 0.85rem 1.25rem !important;
  }
}

@media (max-width: 380px) {
  #modal-event-registration #reg-type-member-btn > span:first-child,
  #modal-event-registration #reg-type-guest-btn > span:first-child {
    font-size: 0.8rem !important;
  }

  #modal-event-registration #reg-type-member-badge,
  #modal-event-registration #reg-type-guest-badge {
    font-size: 0.72rem !important;
    padding: 1px 7px !important;
  }

  #modal-event-registration #reg-upi-qr-img {
    width: 135px !important;
    height: 135px !important;
  }

  #modal-event-registration #reg-upi-intent-link {
    font-size: 0.84rem !important;
  }
}

/* =========================================================
   Superadmin Role Assignment Modal Overlay (Fixed Pop-up)
   ========================================================= */
#role-assign-modal,
div#role-assign-modal.login-screen-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  z-index: 100030 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
}

#role-assign-modal.active,
div#role-assign-modal.login-screen-overlay.active,
#role-assign-modal[style*="display: flex"],
div#role-assign-modal.login-screen-overlay[style*="display: flex"],
#role-assign-modal[style*="display: block"],
div#role-assign-modal.login-screen-overlay[style*="display: block"] {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#role-assign-modal[style*="display: none"],
div#role-assign-modal.login-screen-overlay[style*="display: none"],
#role-assign-modal:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
div#role-assign-modal.login-screen-overlay:not(.active):not([style*="display: flex"]):not([style*="display: block"]) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#role-assign-modal .login-card,
div#role-assign-modal .login-card {
  position: relative !important;
  width: 100% !important;
  max-width: 560px !important;
  max-height: 90vh !important;
  background: var(--card-bg, #ffffff) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: var(--radius-xl, 18px) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45) !important;
  z-index: 100031 !important;
  overflow-y: auto !important;
  margin: auto !important;
  display: flex !important;
  flex-direction: column !important;
  transform: none !important;
  padding: 1.75rem !important;
  box-sizing: border-box !important;
}

/* =========================================================
   Fixed Overlay Popup Styling for Superadmin & Contact Modals
   ========================================================= */
#superadmin-member-modal,
#superadmin-member-preview-modal,
#contact-modal,
#photo-modal,
#link-modal,
#lbn-sub-edit-modal,
#email-action-modal,
#bulk-email-pending-modal,
#bulk-email-progress-modal {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  z-index: 100030 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
}

#superadmin-member-modal.active,
#superadmin-member-modal[style*="display: flex"],
#superadmin-member-modal[style*="display: block"],
#superadmin-member-preview-modal.active,
#superadmin-member-preview-modal[style*="display: flex"],
#superadmin-member-preview-modal[style*="display: block"],
#contact-modal.active,
#contact-modal[style*="display: flex"],
#contact-modal[style*="display: block"],
#photo-modal.active,
#photo-modal[style*="display: flex"],
#photo-modal[style*="display: block"],
#link-modal.active,
#link-modal[style*="display: flex"],
#link-modal[style*="display: block"],
#lbn-sub-edit-modal.active,
#lbn-sub-edit-modal[style*="display: flex"],
#lbn-sub-edit-modal[style*="display: block"],
#email-action-modal.active,
#email-action-modal[style*="display: flex"],
#email-action-modal[style*="display: block"],
#bulk-email-pending-modal.active,
#bulk-email-pending-modal[style*="display: flex"],
#bulk-email-pending-modal[style*="display: block"],
#bulk-email-progress-modal.active,
#bulk-email-progress-modal[style*="display: flex"],
#bulk-email-progress-modal[style*="display: block"] {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#superadmin-member-modal[style*="display: none"],
#superadmin-member-preview-modal[style*="display: none"],
#contact-modal[style*="display: none"],
#photo-modal[style*="display: none"],
#link-modal[style*="display: none"],
#lbn-sub-edit-modal[style*="display: none"],
#email-action-modal[style*="display: none"],
#bulk-email-pending-modal[style*="display: none"],
#bulk-email-progress-modal[style*="display: none"] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#superadmin-member-modal .login-card,
#superadmin-member-preview-modal .login-card,
#contact-modal .login-card,
#photo-modal .login-card,
#link-modal .login-card,
#lbn-sub-edit-modal .login-card,
#email-action-modal .login-card,
#bulk-email-pending-modal .login-card,
#bulk-email-progress-modal .login-card {
  position: relative !important;
  width: 100% !important;
  max-width: 680px !important;
  max-height: 90vh !important;
  background: var(--card-bg, #ffffff) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: var(--radius-xl, 18px) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45) !important;
  z-index: 100031 !important;
  overflow-y: auto !important;
  margin: auto !important;
  display: flex !important;
  flex-direction: column !important;
  transform: none !important;
  padding: 1.75rem !important;
  box-sizing: border-box !important;
}

/* =========================================================
   LCIF Floating Popup Modals (True Fixed Overlay Popups)
   ========================================================= */
#lcif-add-modal,
#lcif-import-modal,
div#lcif-add-modal,
div#lcif-import-modal {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.75) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 200090 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
}

#lcif-add-modal.active,
#lcif-add-modal[style*="display: flex"],
#lcif-add-modal[style*="display: block"],
#lcif-import-modal.active,
#lcif-import-modal[style*="display: flex"],
#lcif-import-modal[style*="display: block"] {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#lcif-add-modal[style*="display: none"],
#lcif-add-modal:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
#lcif-import-modal[style*="display: none"],
#lcif-import-modal:not(.active):not([style*="display: flex"]):not([style*="display: block"]) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#lcif-add-modal .modal-card,
#lcif-add-modal .modal-content,
#lcif-import-modal .modal-card,
#lcif-import-modal .modal-content {
  position: relative !important;
  width: 100% !important;
  max-width: 580px !important;
  background: var(--card-bg, #ffffff) !important;
  border-radius: var(--radius-xl, 20px) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5) !important;
  max-height: 90vh !important;
  overflow: hidden !important;
  margin: auto !important;
  z-index: 200091 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

#lcif-club-donors-modal .modal-card,
#lcif-club-donors-modal .modal-content {
  position: relative !important;
  width: 100% !important;
  max-width: 960px !important;
  height: 88vh !important;
  max-height: 88vh !important;
  background: var(--card-bg, #ffffff) !important;
  border-radius: var(--radius-xl, 20px) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5) !important;
  overflow: hidden !important;
  margin: auto !important;
  z-index: 200096 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

#lcif-club-modal-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: calc(88vh - 180px) !important;
  overflow-y: auto !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin !important;
  scrollbar-color: #94a3b8 #f1f5f9 !important;
}

#lcif-club-modal-body::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}

#lcif-club-modal-body::-webkit-scrollbar-track {
  background: #f1f5f9 !important;
}

#lcif-club-modal-body::-webkit-scrollbar-thumb {
  background: #94a3b8 !important;
  border-radius: 99px !important;
}

#lcif-club-modal-body::-webkit-scrollbar-thumb:hover {
  background: #64748b !important;
}

#lcif-club-modal-body thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  background: var(--bg-color, #f8fafc) !important;
  box-shadow: 0 1.5px 0 var(--border-color, #e2e8f0) !important;
}

/* Hierarchy Active Selection Highlight Pulse */
@keyframes hierarchyPulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7);
    border-color: #4f46e5 !important;
  }
  50% {
    box-shadow: 0 0 0 10px rgba(79, 70, 229, 0.25);
    border-color: #4f46e5 !important;
    background-color: rgba(99, 102, 241, 0.08) !important;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    border-color: #4f46e5 !important;
  }
}

.hierarchy-selected-highlight {
  animation: hierarchyPulseGlow 1.2s ease-in-out 3 !important;
  border-color: #4f46e5 !important;
  scroll-margin-top: 100px;
}

/* =========================================================
   RESPONSIVE COMPACT HERO BANNERS (My Club, My Zone, My Region)
   ========================================================= */
.btn-text-short {
  display: none !important;
}
.btn-text-full {
  display: inline !important;
}

.lion-hero-banner {
  border-radius: var(--radius-xl, 20px) !important;
  padding: 1.5rem 1.75rem !important;
  color: #ffffff !important;
  margin-bottom: 1.25rem !important;
  position: relative !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* Dynamic Theme Adaptation for Club, Zone & Region Banners */
.lion-hero-banner,
.lion-hero-banner.lion-hero-club,
.lion-hero-banner.lion-hero-zone,
.lion-hero-banner.lion-hero-region,
.theme-banner-box,
html.theme-immersive .lion-hero-banner,
body.theme-immersive .lion-hero-banner,
html.theme-immersive .lion-hero-banner.lion-hero-club,
body.theme-immersive .lion-hero-banner.lion-hero-club,
html.theme-immersive .lion-hero-banner.lion-hero-zone,
body.theme-immersive .lion-hero-banner.lion-hero-zone,
html.theme-immersive .lion-hero-banner.lion-hero-region,
body.theme-immersive .lion-hero-banner.lion-hero-region,
html.theme-immersive .theme-banner-box,
body.theme-immersive .theme-banner-box {
  background: var(--theme-banner-gradient, linear-gradient(135deg, #1e3a8a, #2563eb, #3b82f6)) !important;
  box-shadow: 0 8px 24px var(--primary-shadow, rgba(37,99,235,0.2)) !important;
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

.lion-hero-controls .btn-export-pdf {
  color: var(--primary-color, #1e3a8a) !important;
  background: #ffffff !important;
}

.lion-hero-switch-box {
  background: rgba(0, 0, 0, 0.22) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  backdrop-filter: blur(4px) !important;
}

.lion-hero-switch-select {
  background: #ffffff !important;
  color: var(--primary-color, #1e3a8a) !important;
}

.lion-hero-watermark {
  display: none !important;
}

.lion-hero-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 0.2rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}

.lion-hero-title {
  font-size: 1.75rem;
  font-weight: 900;
  margin: 0.15rem 0;
  letter-spacing: -0.5px;
  color: #ffffff;
  line-height: 1.2;
}

.lion-hero-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  line-height: 1.4;
}

.lion-hero-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  z-index: 2;
}

.lion-hero-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lion-hero-controls .btn-export-pdf {
  font-weight: 800;
  border-radius: 20px;
  padding: 0.4rem 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
}

.lion-hero-switch-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 0.35rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.lion-hero-switch-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.lion-hero-switch-select {
  font-weight: 700;
  border-radius: 6px;
  border: none;
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.lion-club-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.75rem;
}

/* Mobile Screen Reductions (<= 768px) */
@media (max-width: 768px) {
  .btn-text-full {
    display: none !important;
  }
  .btn-text-short {
    display: inline !important;
  }

  #my-club-view {
    padding: 0.25rem 0 2rem 0 !important;
  }
  #my-zone-container,
  #my-region-container {
    padding: 0.15rem 0 2rem 0 !important;
  }

  .lion-hero-banner {
    padding: 0.65rem 0.85rem !important;
    border-radius: 12px !important;
    margin-bottom: 0.65rem !important;
  }

  .lion-hero-watermark {
  display: none !important;
}

  .lion-hero-header-badge {
    padding: 0.12rem 0.45rem !important;
    font-size: 0.62rem !important;
    margin-bottom: 0.15rem !important;
    gap: 0.25rem !important;
  }

  .lion-hero-title {
    font-size: 1.15rem !important;
    margin: 0.1rem 0 !important;
    letter-spacing: -0.3px !important;
    line-height: 1.2 !important;
  }

  .lion-hero-subtitle {
    font-size: 0.74rem !important;
    line-height: 1.25 !important;
    margin: 0.05rem 0 0.35rem 0 !important;
  }

  .lion-hero-content {
    gap: 0.35rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .lion-hero-controls {
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0.35rem !important;
    margin-top: 0.2rem !important;
  }

  .lion-hero-controls .btn-export-pdf {
    padding: 0.28rem 0.55rem !important;
    font-size: 0.72rem !important;
    border-radius: 10px !important;
    flex-shrink: 0 !important;
    gap: 0.25rem !important;
  }

  .lion-hero-switch-box {
    padding: 0.2rem 0.4rem !important;
    border-radius: 6px !important;
    flex: 0 0 auto !important;
    max-width: none !important;
    justify-content: flex-end !important;
    gap: 0.3rem !important;
    height: 36px !important;
    box-sizing: border-box !important;
  }

  .lion-hero-switch-label {
    font-size: 0.66rem !important;
    white-space: nowrap !important;
  }

  .lion-hero-switch-select {
    padding: 0.2rem 0.35rem !important;
    font-size: 0.72rem !important;
    max-width: 135px !important;
    border-radius: 4px !important;
  }

  /* Club action buttons on mobile */
  .lion-club-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 0.3rem !important;
    align-items: center !important;
    margin-top: 0.4rem !important;
  }

  .lion-club-actions .btn {
    padding: 0.25rem 0.55rem !important;
    font-size: 0.72rem !important;
    border-radius: 6px !important;
    gap: 0.25rem !important;
  }

  .lion-club-actions #my-club-count-badge {
    font-size: 0.7rem !important;
    width: 100% !important;
    margin-top: 0.1rem !important;
  }

  /* Quick Jump Navigation pills on mobile: Horizontal swipeable bar */
  .lion-quick-nav-pills {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 0.3rem !important;
    margin-bottom: 0.75rem !important;
    gap: 0.3rem !important;
    border-radius: 10px !important;
    scrollbar-width: none !important;
  }

  .lion-quick-nav-pills::-webkit-scrollbar {
    display: none !important;
  }

  .lion-quick-nav-pills a.btn,
  .lion-quick-nav-pills button.btn {
    font-size: 0.72rem !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .lion-quick-nav-pills .btn-pill-pdf {
    font-size: 0.72rem !important;
    padding: 0.25rem 0.5rem !important;
    margin-left: 0 !important;
  }
}

/* ==========================================================================
   Sub-Screen App Bar & Below Section Spacing Optimization
   Eliminates excessive gap between [← Back] bar and the content sections
   ========================================================================== */
#subscreen-app-bar {
  margin-bottom: 0.35rem !important;
}

/* Reset excessive container top padding when inside a subscreen */
#subscreen-app-bar ~ section[id$="-container"],
#subscreen-app-bar ~ .directory-container,
#subscreen-app-bar ~ #search-filter-section,
#subscreen-app-bar ~ section[id="hierarchy-container"],
#subscreen-app-bar ~ section[id="calendar-container"],
#subscreen-app-bar ~ section[id="broadcasts-container"],
#subscreen-app-bar ~ section[id="service-analytics-container"],
#subscreen-app-bar ~ section[id="membership-analytics-container"],
#subscreen-app-bar ~ section[id="vault-container"],
#subscreen-app-bar ~ section[id="lbn-container"],
#subscreen-app-bar ~ section[id="my-club-container"],
#subscreen-app-bar ~ section[id="my-zone-container"],
#subscreen-app-bar ~ section[id="my-region-container"],
#subscreen-app-bar ~ section[id="my-district-container"] {
  padding-top: 0 !important;
}

#subscreen-app-bar ~ section[id$="-container"],
#subscreen-app-bar ~ #search-filter-section {
  margin-top: 0 !important;
}

#subscreen-app-bar ~ section[id$="-container"] > .modal:first-child,
#subscreen-app-bar ~ section[id$="-container"] > .modal-overlay:first-child {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* ==========================================================================
   District Events Interactive Calendar View
   ========================================================================== */
.cal-view-toggle-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.cal-view-toggle-btn.active {
  background: var(--card-bg);
  color: var(--primary-color);
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-day-cell {
  min-height: 48px;
  border-radius: 10px;
  background: var(--bg-color);
  border: 1.5px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  user-select: none;
  padding: 4px 2px;
}
.cal-day-cell:hover {
  background: var(--primary-light, rgba(79, 70, 229, 0.1));
  border-color: rgba(79, 70, 229, 0.3);
  transform: translateY(-1px);
}
.cal-day-cell.cal-day-other-month {
  opacity: 0.35;
}
.cal-day-cell.cal-day-today {
  border-color: var(--primary-color);
  background: rgba(79, 70, 229, 0.08);
}
.cal-day-cell.cal-day-today .cal-day-num {
  color: var(--primary-color);
  font-weight: 800;
}
/* Event Date Fill Color */
.cal-day-cell.cal-day-has-event {
  background: var(--cal-fill-bg, #4f46e5) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.cal-day-cell.cal-day-has-event:hover {
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.cal-day-cell.cal-day-has-event .cal-day-num {
  color: #ffffff !important;
  font-weight: 900 !important;
}
.cal-day-cell.cal-day-has-event .cal-event-dot {
  background: #ffffff !important;
}
.cal-day-cell.cal-day-has-event.cal-day-other-month {
  opacity: 0.65;
}
.cal-day-cell.cal-day-has-event.cal-day-today {
  outline: 2.5px solid #f59e0b;
  outline-offset: 1.5px;
}
.cal-day-cell.cal-day-has-event.cal-day-selected {
  outline: 3.5px solid #2563eb !important;
  outline-offset: 2.5px !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5) !important;
  transform: scale(1.06);
  z-index: 3;
}

/* Regular Date Selected (No event) */
.cal-day-cell.cal-day-selected:not(.cal-day-has-event) {
  border-color: #2563eb !important;
  background: #2563eb !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transform: scale(1.04);
}
.cal-day-cell.cal-day-selected:not(.cal-day-has-event) .cal-day-num {
  color: #ffffff !important;
  font-weight: 900;
}
.cal-day-cell.cal-day-selected:not(.cal-day-has-event) .cal-event-dot {
  background: #ffffff !important;
}
.cal-day-num {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1;
}
.cal-day-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-top: 4px;
  min-height: 7px;
}
.cal-event-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4f46e5;
}
@media (max-width: 600px) {
  .cal-day-cell {
    min-height: 40px;
    padding: 2px;
  }
  .cal-day-num {
    font-size: 0.8rem;
  }
  .cal-event-dot {
    width: 5px;
    height: 5px;
  }
}

/* Header logout button hidden */
#logout-btn {
  display: none !important;
}

/* Header Back Button */
#header-back-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 11px;
  border: 1.5px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  padding: 0;
  flex-shrink: 0;
}
#header-back-btn:hover {
  background: rgba(37, 99, 235, 0.08) !important;
  color: var(--primary-color, #2563eb) !important;
  border-color: var(--primary-color, #2563eb) !important;
  transform: translateX(-2px);
}
#header-back-btn:active {
  transform: scale(0.95);
}

/* Subscreen floating bar completely removed (Replaced by top header back arrow) */
#subscreen-app-bar {
  display: none !important;
}

/* Member profile drawer header, back button, and [X] button hidden */
#close-sidebar,
.profile-sidebar .sidebar-header,
.profile-sidebar .inline-back-btn {
  display: none !important;
}

/* ==========================================================================
   Comprehensive Mobile Responsiveness & Multi-Resolution Ergonomics
   (Optimized for 320px, 360px, 375px, 390px, 412px, and 430px Viewports)
   ========================================================================== */

/* Safe-Area Inset Support for Modern Notches & Home Gestures */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

header {
  padding-top: max(0.5rem, env(safe-area-inset-top, 0px));
}

.bottom-nav {
  padding-bottom: max(0.45rem, env(safe-area-inset-bottom, 0px)) !important;
  padding-left: max(0.5rem, env(safe-area-inset-left, 0px)) !important;
  padding-right: max(0.5rem, env(safe-area-inset-right, 0px)) !important;
}

/* iOS Safari Auto-Zoom Prevention: Ensure all interactive form inputs are >= 16px */
@media (max-width: 768px) {
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Quick Suggestion Pills: Wrap naturally without horizontal scroll */
.quick-search-tags {
  display: flex !important;
  flex-wrap: wrap !important;
  overflow-x: visible !important;
  gap: 0.4rem !important;
  padding: 0.25rem 0.15rem !important;
  width: 100% !important;
  max-width: 100% !important;
}
.quick-search-label {
  flex-shrink: 0 !important;
  align-self: center !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
}
.quick-tag-btn {
  white-space: nowrap !important;
  padding: 0.3rem 0.65rem !important;
  font-size: 0.76rem !important;
  border-radius: 9999px !important;
  line-height: 1.2 !important;
}

/* Strictly Circular Photos & Avatars across all modules */
.avatar,
.avatar img,
.sidebar-avatar,
.sidebar-avatar img,
.user-avatar,
#header-user-avatar,
#header-profile-btn,
.member-photo,
.member-avatar,
.profile-avatar,
.leader-avatar,
.officer-avatar,
.celebration-avatar,
.member-card .avatar,
.member-card img,
.member-card .avatar img,
.table-member-cell .avatar,
.table-member-cell img,
.my-club-officer img,
.hierarchy-card img,
.leader-card img,
#profile-card-avatar,
#drawer-avatar,
img.user-avatar {
  border-radius: 50% !important;
  aspect-ratio: 1 / 1 !important;
}

.member-card .avatar {
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  min-height: 56px !important;
  max-width: 56px !important;
  max-height: 56px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
}

.member-card .avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 50% !important;
  display: block !important;
}

/* Compact Mobile Header (<= 400px: iPhone SE, Galaxy A-series, Pixel) */
@media (max-width: 400px) {
  .nav-content {
    padding: 0.45rem 0.65rem !important;
    gap: 0.35rem !important;
  }
  .brand {
    gap: 0.4rem !important;
  }
  .brand-logo-img {
    width: 38px !important;
    height: 38px !important;
    border-radius: 9px !important;
  }
  .brand h1 {
    font-size: 1.02rem !important;
    letter-spacing: -0.35px !important;
    white-space: nowrap !important;
  }
  #header-back-btn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 9px !important;
  }
  #open-notifications-btn,
  #open-celebrations-btn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 9px !important;
  }
  #header-profile-btn,
  #header-user-avatar {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    border-radius: 50% !important;
    font-size: 0.82rem !important;
  }
}

/* Ultra-Compact Bottom Navigation (<= 360px: iPhone SE 1st Gen & small screens) */
@media (max-width: 360px) {
  .bottom-nav-item {
    font-size: 0.65rem !important;
    padding: 0.35rem 0.1rem !important;
    gap: 0.2rem !important;
  }
  .bottom-nav-item i,
  .bottom-nav-item svg {
    width: 18px !important;
    height: 18px !important;
  }
}

/* Responsive Data Tables & Horizontal Overflow Protection */
.table-responsive,
.member-table-wrap,
.data-table-container,
.responsive-table-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Mobile Profile Card Optimizations */
@media (max-width: 640px) {
  .sidebar-overlay .profile-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  }
  .sidebar-content {
    padding: 1.5rem 1rem !important;
    gap: 1.15rem !important;
  }
  .sidebar-avatar {
    width: 108px !important;
    height: 108px !important;
    min-width: 108px !important;
    min-height: 108px !important;
  }
  #sidebar-name {
    font-size: 1.35rem !important;
  }
}

/* Event Image Dropbox Styling */
.event-image-dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.45) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.event-image-dropzone:hover,
.event-image-dropzone.dragover {
  border-color: var(--primary-color, #4f46e5) !important;
  background: rgba(99, 102, 241, 0.08) !important;
  transform: translateY(-1px);
}
.event-image-dropzone.dragover {
  border-style: solid !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15) !important;
}

/* Real-Time Live Session Pulse & Badge */
@keyframes livePulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1.15);
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.live-pulse-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: #22c55e;
  border-radius: 50%;
  animation: livePulse 2s infinite ease-in-out;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #dcfce7;
  color: #15803d;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Header Superadmin Button permanently hidden from top bar per user request (accessible in Profile screen) */
#open-superadmin-panel {
  display: none !important;
}

/* ====================================================
   UNIVERSAL CROSS-DEVICE & CROSS-OS RESPONSIVE ENGINE
   Optimized for: iOS (iPhone/iPad), Android (All sizes),
   Windows (Desktop/Tablet), macOS (Retina), Linux,
   Foldables, Small Screens (320px) to Ultrawide (4K).
   ==================================================== */

:root {
  /* Safe Area Insets for iOS Notch, Dynamic Island, and Android Gesture Bars */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Dynamic Viewport Units for Modern Mobile Browsers */
  --app-height: 100dvh;
}

/* 1. Global Box Sizing & Fluid Reset */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: auto;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  padding-left: var(--safe-left) !important;
  padding-right: var(--safe-right) !important;
}

/* Prevent iOS Safari automatic zooming on input focus (causes horizontal shifts) */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important; /* iOS threshold to disable unwanted zoom */
  }
}

/* 2. Responsive Images, Media & Embeds */
img, svg, video, canvas {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* 3. Header & Safe Area Integration */
header {
  padding-top: max(0.85rem, var(--safe-top)) !important;
  padding-left: max(1rem, var(--safe-left)) !important;
  padding-right: max(1rem, var(--safe-right)) !important;
}

.nav-content {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

/* 4. Main Container & Ultrawide Display Clamping */
.main-content,
.app-container,
#app-home-section,
#pro-teams-showcase-section,
.search-filter-section,
.directory-container,
.stats-row,
#stats-row-section {
  width: 100%;
  max-width: 1440px;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

/* 5. Fluid Responsive Module Launcher Across All Resolutions */
/* Ultrawide & High-Resolution Desktops (>= 1200px) */
@media (min-width: 1200px) {
  #app-home-section {
    max-width: 1140px;
    margin: 2rem auto !important;
  }
  .module-launcher-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 1.5rem 1.25rem !important;
    max-width: 1140px !important;
  }
  .module-card {
    flex: 0 1 155px !important;
    width: 155px !important;
  }
}

/* Laptops & Standard Desktops (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  #app-home-section {
    max-width: 1040px;
    margin: 1.5rem auto !important;
  }
  .module-launcher-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 1.25rem 1.1rem !important;
    max-width: 1040px !important;
  }
  .module-card {
    flex: 0 1 145px !important;
    width: 145px !important;
    padding: 1.15rem 0.5rem 0.95rem 0.5rem !important;
  }
  .module-card-icon {
    width: 62px !important;
    height: 62px !important;
  }
  .module-card-title {
    font-size: 0.82rem !important;
  }
}

/* Tablets (768px - 991px: iPad, Android Tablets) */
@media (min-width: 768px) and (max-width: 991px) {
  #app-home-section {
    max-width: 920px;
    margin: 1.25rem auto !important;
  }
  .module-launcher-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 1.1rem 0.9rem !important;
    max-width: 920px !important;
  }
  .module-card {
    flex: 0 1 140px !important;
    width: 140px !important;
    padding: 1rem 0.45rem 0.85rem 0.45rem !important;
  }
  .module-card-icon {
    width: 58px !important;
    height: 58px !important;
  }
  .module-card-title {
    font-size: 0.8rem !important;
  }
  .nav-content {
    padding: 0.65rem 1rem !important;
  }
}

/* Phablets & Foldables (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
  #app-home-section {
    margin: 1rem auto !important;
  }
  .module-launcher-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.85rem 0.65rem !important;
  }
  .module-card {
    flex: 0 1 125px !important;
    width: 125px !important;
    padding: 0.85rem 0.35rem 0.75rem 0.35rem !important;
    border-radius: 16px !important;
  }
  .module-card-icon {
    width: 54px !important;
    height: 54px !important;
    margin-bottom: 0.45rem !important;
  }
  .module-card-title {
    font-size: 0.78rem !important;
  }
}

/* Standard Mobile Devices (361px - 480px: iPhone, Galaxy, Pixel) */
@media (max-width: 480px) {
  #app-home-section {
    margin: 0.35rem auto 0.25rem auto !important;
    padding: 0 0.5rem !important;
  }
  .module-launcher-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.55rem 0.35rem !important;
    width: 100% !important;
    margin-bottom: 0.25rem !important;
  }
  .module-card {
    width: auto !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
    padding: 0.65rem 0.25rem 0.5rem 0.25rem !important;
    border-radius: 14px !important;
    min-height: auto !important;
  }
  .module-card-icon {
    width: 50px !important;
    height: 50px !important;
    margin-bottom: 0.35rem !important;
  }
  .module-card-icon svg {
    width: 40px !important;
    height: 40px !important;
  }
  .module-card-title {
    font-size: 0.75rem !important;
    line-height: 1.15 !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }
  #pro-teams-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  #pro-teams-showcase-section > div {
    padding: 1rem 0.85rem !important;
    border-radius: 14px !important;
  }
}

/* ====================================================
   COMPREHENSIVE MULTI-DEVICE RESPONSIVE SUITE
   - Ultra-compact phones (<= 360px)
   - Standard phones (361px - 480px)
   - Phablets & Foldables (481px - 767px)
   - Tablets portrait & landscape (768px - 1024px)
   - Laptops & Desktops (1025px - 1439px)
   - Ultrawide & 4K (>= 1440px)
   - Mobile Landscape Orientation
   - Universal Modals & Overlays
   - Forms & Touch Accessibility
   - Horizontal Scroll & Spillage Guard
   ==================================================== */

/* 1. Header & Brand Title - Single Line Constraint Across All Screen Sizes */
header {
  padding: max(0.5rem, var(--safe-top)) max(0.75rem, var(--safe-right)) max(0.5rem, var(--safe-bottom)) max(0.75rem, var(--safe-left)) !important;
}

.brand {
  display: flex !important;
  align-items: center !important;
  gap: clamp(0.25rem, 1.8vw, 0.65rem) !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
}

.brand h1 {
  font-size: clamp(0.85rem, 3.8vw, 1.25rem) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  letter-spacing: -0.3px !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

.brand-logo-img {
  width: clamp(30px, 8vw, 42px) !important;
  height: clamp(30px, 8vw, 42px) !important;
  flex-shrink: 0 !important;
}

.brand-dual-logo-box {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  border: none !important;
  width: clamp(42px, 11vw, 48px) !important;
  height: clamp(42px, 11vw, 48px) !important;
  box-sizing: border-box !important;
}

.brand-dual-logo-box img.dual-dir-logo,
#header-directory-logo,
.brand-dual-logo-box img.dual-dist-pin,
#header-district-pin {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  mix-blend-mode: normal !important;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  flex-shrink: 0 !important;
}

#header-directory-logo {
  display: none !important;
}

#header-district-pin {
  display: block !important;
}

/* Header utility buttons */
#header-back-btn,
#open-notifications-btn,
#open-celebrations-btn,
#header-profile-btn,
#header-user-avatar {
  flex-shrink: 0 !important;
}

/* 2. Compact & Mini Screens (<= 360px: iPhone SE, Galaxy Z Flip cover screen, etc.) */
@media (max-width: 360px) {
  header {
    padding: max(0.35rem, var(--safe-top)) 0.4rem max(0.35rem, var(--safe-bottom)) 0.4rem !important;
  }
  .brand {
    gap: 0.25rem !important;
  }
  .brand h1 {
    font-size: 0.88rem !important;
  }
  .brand-logo-img {
    width: 30px !important;
    height: 30px !important;
  }
  .brand-dual-logo-box {
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
  }
  .brand-dual-logo-box img.dual-dir-logo,
  #header-directory-logo,
  .brand-dual-logo-box img.dual-dist-pin,
  #header-district-pin {
    width: 100% !important;
    height: 100% !important;
    mix-blend-mode: normal !important;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.25));
  }
  #header-back-btn,
  #open-notifications-btn,
  #open-celebrations-btn,
  #header-profile-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
  }

  .module-launcher-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.45rem 0.3rem !important;
  }
  .module-card {
    padding: 0.6rem 0.2rem !important;
    border-radius: 12px !important;
  }
  .module-card-icon {
    width: 44px !important;
    height: 44px !important;
    margin-bottom: 0.25rem !important;
  }
  .module-card-icon svg {
    width: 34px !important;
    height: 34px !important;
  }
  .module-card-title {
    font-size: 0.68rem !important;
    line-height: 1.12 !important;
  }

  /* Single Column Card Stacking on narrow viewports */
  .directory-grid,
  .stats-grid,
  .cabinet-grid,
  .clubs-grid,
  .governance-grid,
  .past-governors-grid,
  #pro-teams-grid,
  .cards-grid,
  .responsive-form-grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }

  .member-card,
  .stat-card,
  .hierarchy-card,
  .pro-team-card {
    padding: 0.75rem 0.5rem !important;
    border-radius: 12px !important;
  }

  .bottom-nav-item {
    font-size: 0.62rem !important;
    padding: 0.3rem 0.1rem !important;
  }
}

/* 3. Standard Mobile Phones (361px - 480px: Modern iPhones, Galaxy, Pixel) */
@media (min-width: 361px) and (max-width: 480px) {
  .directory-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  .responsive-form-grid {
    grid-template-columns: 1fr !important;
  }
}

/* 4. Foldables, Phablets & Small Tablets (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
  .directory-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)) !important;
    gap: 1rem !important;
  }
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
  }
}

/* 5. Tablets (768px - 1024px: iPad Mini, iPad Air, Galaxy Tab) */
@media (min-width: 768px) and (max-width: 1024px) {
  .directory-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 1.25rem !important;
  }
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  }
}

/* 6. Landscape Mode on Mobile Devices (e.g. Height <= 520px) */
@media (max-height: 520px) and (orientation: landscape) {
  header {
    padding: 0.35rem 1rem !important;
  }
  .brand-logo-img {
    width: 28px !important;
    height: 28px !important;
  }
  .brand h1 {
    font-size: 0.92rem !important;
  }
  .module-launcher-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.65rem !important;
  }
  .module-card {
    padding: 0.5rem 0.25rem !important;
  }
  .module-card-icon {
    width: 44px !important;
    height: 44px !important;
  }
  .modal-card,
  .modal-content,
  .fixed-modal-overlay > div {
    max-height: calc(100dvh - 1rem) !important;
  }
  .modal-card form,
  .modal-content form,
  form[id^="form-superadmin-"] {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 170px) !important;
  }
}

/* 7. Universal Modal Dialog Architecture (Zero Cutoff, Dynamic Safe Height) */
.modal:not(#modal-event-registration):not(#modal-event-reg-success):not(#modal-celebration-subscription):not(#modal-admin-event-roster),
.modal-overlay:not(#modal-event-registration):not(#modal-event-reg-success):not(#modal-celebration-subscription):not(#modal-admin-event-roster),
.fixed-modal-overlay:not(#modal-event-registration):not(#modal-event-reg-success):not(#modal-celebration-subscription):not(#modal-admin-event-roster) {
  padding: max(0.5rem, var(--safe-top)) max(0.5rem, var(--safe-right)) max(0.5rem, var(--safe-bottom)) max(0.5rem, var(--safe-left)) !important;
  box-sizing: border-box !important;
}

.modal-card:not(#modal-event-registration .modal-card):not(#modal-event-reg-success .modal-card):not(#modal-celebration-subscription .modal-card):not(#modal-admin-event-roster .modal-card):not(#modal-event-registration *):not(#modal-event-reg-success *):not(#modal-admin-event-roster *),
.modal-content:not(#modal-event-registration .modal-content):not(#modal-event-reg-success .modal-content):not(#modal-celebration-subscription .modal-content):not(#modal-admin-event-roster .modal-content):not(#modal-event-registration *):not(#modal-event-reg-success *):not(#modal-admin-event-roster *),
.fixed-modal-overlay:not(#modal-event-registration):not(#modal-event-reg-success):not(#modal-celebration-subscription):not(#modal-admin-event-roster) > div,
#modal-pro-team-admin .modal-content,
#modal-pro-team-lightbox > div {
  width: 100% !important;
  max-width: min(calc(100vw - 1rem), 680px) !important;
  max-height: min(92vh, calc(100dvh - 1.25rem)) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  margin: auto !important;
  box-sizing: border-box !important;
}

.modal-card form,
.modal-content form,
form[id^="form-superadmin-"] {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  max-height: calc(100dvh - 170px) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: clamp(0.75rem, 3vw, 1.5rem) !important;
}

/* 8. Touch Ergonomics & Form Accessibility */
button, input, select, textarea, a, .tab-btn {
  touch-action: manipulation;
}

@media (pointer: coarse) {
  .btn,
  .tab-btn,
  .filter-select,
  .search-input {
    min-height: 42px !important;
  }
  .btn-icon {
    min-width: 38px !important;
    min-height: 38px !important;
  }
}

/* 9. Universal Horizontal Overflow & Data Table Spillage Protection */
.table-responsive,
.data-table-container,
.audit-logs-card,
.member-table-wrap,
.responsive-table-wrapper,
#superadmin-proteams-view,
div:has(> table) {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin;
}

/* Horizontal pill scroll containers without breaking layout */
.filter-tabs,
.subscreen-tabs {
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar,
.subscreen-tabs::-webkit-scrollbar {
  display: none;
}

/* 10. Standalone PWA & Native App Safe Areas */
@media all and (display-mode: standalone) {
  header {
    padding-top: max(0.85rem, var(--safe-top)) !important;
  }
  .bottom-nav {
    padding-bottom: max(0.5rem, var(--safe-bottom)) !important;
  }
}

@keyframes spinLoader {
  to {
    transform: rotate(360deg);
  }
}

/* Strictly hide district badges, word graphics, and pins on login screen */
#login-district-badge,
#login-district-image,
#login-district-pin {
  display: none !important;
}

/* Post-login hero district pin styling */
#splash-district-pin,
.splash-animated-pin {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  mix-blend-mode: normal !important;
}

/* ====================================================
   Goals & Achievements Module Styles
   ==================================================== */
.goals-header-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%);
  color: #ffffff;
  border-radius: 18px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 25px -5px rgba(30, 58, 138, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.goals-tab-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 4px;
}

.goals-tab-btn {
  padding: 0.65rem 1.25rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1.5px solid var(--border-color, #e2e8f0);
  background: var(--card-bg, #ffffff);
  color: var(--text-muted, #64748b);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.goals-tab-btn:hover {
  background: var(--bg-hover, #f8fafc);
  color: var(--text-color, #0f172a);
}

.goals-tab-btn.active {
  background: #1e40af;
  color: #ffffff;
  border-color: #1e40af;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.25);
}

.goals-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.goals-kpi-box {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.goals-progress-track {
  height: 8px;
  background: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
  margin: 0.5rem 0;
  position: relative;
}

.goals-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.goals-region-card {
  background: var(--card-bg, #ffffff);
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 18px;
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.goals-region-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}

.goals-zone-card {
  background: var(--bg-hover, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-top: 0.75rem;
}

.goals-chair-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

@keyframes goalsFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes goalsPopIn {
  from {
    transform: scale(0.93) translateY(12px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}


/* Leadership Analytics role-based action controls */
.leadership-admin-only {
  display: none;
}

/* ========================================================
   App Appearance & Personal Theme Studio Styles
   ======================================================== */
:root {
  --primary-contrast: #ffffff;
  --primary-gradient: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  --primary-shadow: rgba(30, 58, 138, 0.25);
}

.theme-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
}

.theme-preset-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1rem 0.85rem 1rem;
  border-radius: 14px;
  background: var(--bg-hover, #f8fafc);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-align: left;
  overflow: hidden;
}

.theme-preset-check {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  color: #ffffff;
  background: #10b981;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  z-index: 2;
  white-space: nowrap;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.theme-preset-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-color);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.theme-preset-card.active {
  border-color: var(--primary-color) !important;
  background: var(--primary-light, rgba(30, 58, 138, 0.08)) !important;
  box-shadow: 0 0 0 2px var(--primary-color), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.theme-color-pair {
  display: flex;
  align-items: center;
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.theme-circle-primary {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  position: absolute;
  left: 0;
  top: 4px;
  z-index: 1;
}

.theme-circle-accent {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  position: absolute;
  right: 0;
  bottom: 2px;
  z-index: 2;
}

.theme-quick-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform 0.15s ease;
  display: inline-block;
}
.theme-quick-dot:hover {
  transform: scale(1.18);
}

.theme-tab-btn {
  padding: 0.5rem 1.15rem;
  font-size: 0.84rem;
  font-weight: 700;
  border: 1.5px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.theme-tab-btn.active {
  background: var(--primary-color) !important;
  color: var(--primary-contrast, #ffffff) !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 2px 8px var(--primary-shadow);
}


/* ==========================================================================
   TOTAL THEME TRANSFORMATION (Immersive Banners, Headers & Ambient Backgrounds)
   ========================================================================== */

/* Themed Header & App Bar */
html.theme-immersive header,
body.theme-immersive header {
  background: var(--theme-header-bg, var(--card-bg)) !important;
  border-bottom: 1px solid var(--theme-header-border, rgba(255, 255, 255, 0.16)) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.14) !important;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

html.theme-immersive header .brand h1,
body.theme-immersive header .brand h1 {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}

html.theme-immersive header .brand h1 span,
body.theme-immersive header .brand h1 span {
  color: var(--accent-color, #f59e0b) !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

html.theme-immersive #header-district-badge,
body.theme-immersive #header-district-badge {
  background: var(--theme-header-badge-bg, rgba(255, 255, 255, 0.22)) !important;
  color: var(--theme-header-badge-color, #ffffff) !important;
  border: 1px solid var(--theme-header-badge-border, rgba(255, 255, 255, 0.4)) !important;
  padding: 2px 9px !important;
  border-radius: 12px !important;
  font-weight: 800 !important;
  letter-spacing: 0.6px !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

html.theme-immersive #header-back-btn,
body.theme-immersive #header-back-btn,
html.theme-immersive #open-notifications-btn,
body.theme-immersive #open-notifications-btn {
  background: rgba(255, 255, 255, 0.18) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.32) !important;
  color: #ffffff !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14) !important;
  transition: all 0.2s ease;
}

html.theme-immersive #header-back-btn:hover,
body.theme-immersive #header-back-btn:hover,
html.theme-immersive #open-notifications-btn:hover,
body.theme-immersive #open-notifications-btn:hover {
  background: rgba(255, 255, 255, 0.28) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  transform: translateY(-1px);
}

html.theme-immersive #header-profile-btn,
body.theme-immersive #header-profile-btn {
  border: 2px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25) !important;
  transition: transform 0.2s ease;
}

html.theme-immersive #header-profile-btn:hover,
body.theme-immersive #header-profile-btn:hover {
  transform: scale(1.05);
}

/* Themed Banner Elements Across App */
.theme-banner-box,
html.theme-immersive .theme-banner-box,
body.theme-immersive .theme-banner-box {
  background: var(--theme-banner-gradient, linear-gradient(135deg, #1e3a8a, #3b82f6, #6366f1)) !important;
  transition: background 0.35s ease;
}

/* Ambient Card Polish in Themed Mode */
html.theme-immersive .module-card,
body.theme-immersive .module-card {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

html.theme-immersive .module-card:hover,
body.theme-immersive .module-card:hover {
  border-color: transparent !important;
  box-shadow: none !important;
  transform: translateY(-2px);
  background: rgba(37, 99, 235, 0.06) !important;
}

/* Theme Preset Card Banner Mini Preview */
.theme-preset-banner-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  width: 100%;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* LCIF Filter Bar Responsive Alignment */
.lcif-filter-bar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr)) minmax(240px, 1.4fr);
  gap: 0.85rem;
  align-items: end;
  width: 100%;
}

.lcif-filter-bar-grid .lcif-filter-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lcif-filter-bar-grid .lcif-filter-field label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
}

.lcif-filter-bar-grid select,
.lcif-filter-bar-grid input {
  height: 40px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  border-radius: 10px !important;
  border: 1.5px solid var(--border-color) !important;
  background: var(--card-bg) !important;
  color: var(--text-color) !important;
  font-size: 0.84rem !important;
}

.lcif-filter-bar-grid select {
  font-weight: 700 !important;
  padding: 0 0.75rem !important;
  cursor: pointer;
}

@media (max-width: 1320px) {
  .lcif-filter-bar-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .lcif-filter-bar-grid .lcif-search-col {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .lcif-filter-bar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .lcif-filter-bar-grid .lcif-search-col {
    grid-column: 1 / -1;
  }
}

@media (max-width: 500px) {
  .lcif-filter-bar-grid {
    grid-template-columns: 1fr;
  }
}

.my-club-tab-btn[data-clubtab="upload-intl"],
#my-club-upload-intl-btn,
#my-club-report-service-btn {
  display: none !important;
}

/* My Club Analytics & Dashboards Tabs */
.my-club-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  font-size: 0.86rem;
  font-weight: 800;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-color);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.my-club-tab-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.05);
}
.my-club-tab-btn.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3) !important;
}
.my-club-tab-pane {
  animation: fadeInPane 0.25s ease;
}
@keyframes fadeInPane {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* My Zone Analytics & Dashboards Tabs */
.my-zone-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  font-size: 0.86rem;
  font-weight: 800;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-color);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.my-zone-tab-btn:hover {
  border-color: #059669;
  color: #059669;
  background: rgba(16, 185, 129, 0.05);
}
.my-zone-tab-btn.active {
  background: #059669 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3) !important;
}
.my-zone-tab-pane {
  animation: fadeInPane 0.25s ease;
}

/* My Region Analytics & Dashboards Tabs */
.my-region-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  font-size: 0.86rem;
  font-weight: 800;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-color);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.my-region-tab-btn:hover {
  border-color: #7c3aed;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.05);
}
.my-region-tab-btn.active {
  background: #7c3aed !important;
  border-color: #7c3aed !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3) !important;
}
.my-region-tab-pane {
  animation: fadeInPane 0.25s ease;
}

/* ==========================================================================
   COMPREHENSIVE MULTI-DEVICE RESPONSIVE SUITE (Mobile, Tablet, Desktop, 4K)
   ========================================================================== */

/* 1. Global Viewport & Touch Ergonomics */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  position: relative;
}

main, #app {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: clip;
}

.app-container {
  width: 100% !important;
  max-width: 100% !important;
}

/* Images & Media Responsiveness */
img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* 2. Subtab 3x2 Grid Navigation (My Club, My Zone, My Region) */
#my-club-subtabs-bar,
#my-zone-subtabs-bar,
#my-region-subtabs-bar {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 0.65rem 0.75rem !important;
  overflow: visible !important;
  padding: 0.5rem 0 1.25rem 0 !important;
  margin-bottom: 1.5rem !important;
  border-bottom: 2px solid var(--border-color) !important;
  width: 100% !important;
  max-width: 100% !important;
}

.subtabs-bar,
.filter-tabs {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.5rem !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  padding: 0.5rem 0.25rem 0.75rem 0.25rem !important;
  margin-bottom: 1.25rem !important;
  border-bottom: 2px solid var(--border-color) !important;
  width: 100% !important;
  max-width: 100% !important;
}

.subtabs-bar::-webkit-scrollbar,
.filter-tabs::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.my-club-tab-btn,
.my-zone-tab-btn,
.my-region-tab-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 0.45rem !important;
  padding: 0.75rem 0.65rem !important;
  font-size: 0.86rem !important;
  font-weight: 800 !important;
  border-radius: 12px !important;
  border: 1.5px solid var(--border-color) !important;
  background: var(--card-bg) !important;
  color: var(--text-color) !important;
  cursor: pointer !important;
  width: 100% !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.d360-tab-btn,
.filter-tab-btn {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* 3. Universal Hero Banner Responsiveness */
.lion-hero-banner {
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.lion-hero-content {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1rem !important;
  flex-wrap: wrap !important;
}

.lion-hero-controls {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  flex-wrap: wrap !important;
}

/* 4. Universal Data Table Responsive Wrapping */
div:has(> table),
.table-responsive,
.data-table-wrap,
div[style*="overflow-x: auto"] {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin;
}

table {
  width: 100%;
  border-collapse: collapse;
}

/* 5. Mobile Screens (<= 640px) */
@media screen and (max-width: 640px) {
  /* Subtabs 3x2 grid on mobile */
  #my-club-subtabs-bar,
  #my-zone-subtabs-bar,
  #my-region-subtabs-bar {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.45rem !important;
    padding: 0.35rem 0 0.85rem 0 !important;
    margin-bottom: 1rem !important;
  }

  .my-club-tab-btn,
  .my-zone-tab-btn,
  .my-region-tab-btn {
    padding: 0.55rem 0.25rem !important;
    font-size: 0.73rem !important;
    border-radius: 10px !important;
    gap: 0.25rem !important;
    white-space: normal !important;
    line-height: 1.18 !important;
    text-align: center !important;
    min-height: 48px !important;
  }

  .d360-tab-btn {
    padding: 0.45rem 0.8rem !important;
    font-size: 0.8rem !important;
    border-radius: 10px !important;
    gap: 0.35rem !important;
  }

  /* Hero banner on mobile */
  .lion-hero-banner {
    padding: 0.85rem 1rem !important;
    border-radius: 14px !important;
    margin-bottom: 0.85rem !important;
  }

  .lion-hero-content {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
  }

  .lion-hero-title {
    font-size: 1.25rem !important;
    line-height: 1.2 !important;
  }

  .lion-hero-subtitle {
    font-size: 0.78rem !important;
    line-height: 1.35 !important;
    margin-top: 0.2rem !important;
  }

  .lion-hero-controls {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.45rem !important;
    margin-top: 0.35rem !important;
    align-items: stretch !important;
  }

  .lion-hero-controls .btn-refresh-zone,
  .lion-hero-controls .btn-refresh-region,
  .lion-hero-controls .btn-refresh-club,
  .lion-hero-controls .btn-export-pdf {
    width: 100% !important;
    height: 36px !important;
    padding: 0.35rem 0.5rem !important;
    font-size: 0.78rem !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  .lion-hero-switch-box,
  .lion-hero-scope-badge {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    flex: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.25rem 0.6rem !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
  }

  .lion-hero-switch-label {
    white-space: nowrap !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
  }

  .lion-hero-switch-select {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 28px !important;
    font-size: 0.78rem !important;
    padding: 0 0.4rem !important;
    border-radius: 6px !important;
  }

  /* Dashboard Cards & KPI Grids on Mobile */
  div[style*="grid-template-columns: repeat(auto-fit, minmax(170px, 1fr))"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
  }

  div[style*="grid-template-columns: repeat(auto-fit, minmax(210px, 1fr))"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  div[style*="grid-template-columns: repeat(auto-fit, minmax(260px, 1fr))"] {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }

  /* Table typography on mobile */
  table th, table td {
    padding: 0.5rem 0.4rem !important;
    font-size: 0.78rem !important;
  }

  /* Modals on Mobile */
  .fixed-modal-overlay,
  .modal-overlay {
    padding: 0.5rem !important;
    align-items: flex-end !important;
  }

  .modal-card,
  .lcif-modal-card,
  .goals-modal-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 18px 18px 0 0 !important;
    max-height: 94vh !important;
  }

  #lcif-club-donors-modal .modal-card {
    height: 92vh !important;
    max-height: 92vh !important;
  }

  #lcif-club-modal-tabs {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    scrollbar-width: none !important;
    padding-bottom: 0.25rem !important;
  }

  #lcif-club-modal-tabs button {
    flex-shrink: 0 !important;
    padding: 0.35rem 0.75rem !important;
    font-size: 0.76rem !important;
  }
}

/* 6. Ultra-Compact Mobile Phones (<= 380px: iPhone SE, Galaxy Fold cover) */
@media screen and (max-width: 380px) {
  .lion-hero-title {
    font-size: 1.15rem !important;
  }

  .lion-hero-controls {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.35rem !important;
  }

  .lion-hero-controls .btn-refresh-zone,
  .lion-hero-controls .btn-refresh-region,
  .lion-hero-controls .btn-refresh-club,
  .lion-hero-controls .btn-export-pdf {
    width: 100% !important;
    height: 34px !important;
    font-size: 0.74rem !important;
  }

  .lion-hero-switch-box,
  .lion-hero-scope-badge {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    flex: none !important;
  }

  .lion-hero-switch-label {
    font-size: 0.68rem !important;
  }

  .lion-hero-switch-select {
    height: 26px !important;
    font-size: 0.72rem !important;
  }

  div[style*="grid-template-columns: repeat(auto-fit, minmax(170px, 1fr))"] {
    grid-template-columns: 1fr !important;
  }
}

/* 7. Tablet Displays (641px - 1024px: iPad, Android Tablets) */
@media screen and (min-width: 641px) and (max-width: 1024px) {
  .lion-hero-banner {
    padding: 1.25rem 1.5rem !important;
  }

  .lion-hero-title {
    font-size: 1.45rem !important;
  }

  div[style*="grid-template-columns: repeat(auto-fit, minmax(170px, 1fr))"] {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
    gap: 0.85rem !important;
  }

  div[style*="grid-template-columns: repeat(auto-fit, minmax(210px, 1fr))"] {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 0.85rem !important;
  }
}

/* 8. Desktop & Large Screens (>= 1025px) */
@media screen and (min-width: 1025px) {
  .lion-hero-banner {
    padding: 1.5rem 1.85rem !important;
  }

  .lion-hero-title {
    font-size: 1.7rem !important;
  }

  .lion-hero-controls {
    flex-wrap: nowrap !important;
  }

  .lion-hero-switch-box {
    min-width: 240px !important;
  }
}

/* 9. Landscape Mobile Optimization (e.g. max-height 500px) */
@media screen and (max-height: 500px) and (orientation: landscape) {
  header {
    padding: 0.35rem 1rem !important;
  }

  .lion-hero-banner {
    padding: 0.65rem 1rem !important;
    margin-bottom: 0.65rem !important;
  }

  .lion-hero-title {
    font-size: 1.15rem !important;
  }

  .modal-card,
  .lcif-modal-card,
  .goals-modal-card {
    max-height: 98vh !important;
  }
}

/* 10. Apple / Android Safe-Area Inset Handling */
@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left, 0px) !important;
    padding-right: env(safe-area-inset-right, 0px) !important;
  }

  header {
    padding-top: max(0.6rem, env(safe-area-inset-top, 0px)) !important;
  }
}

/* Superadmin Roles Table: Avatar Pin Badge */
.role-row .role-pin-btn {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.role-row:hover .role-pin-btn,
.role-row .role-pin-btn.is-pinned {
  opacity: 1 !important;
  pointer-events: auto !important;
}
.role-pin-btn:hover {
  transform: scale(1.18) !important;
}

/* ====================================================
   Option Settings & Profile Responsive Layout
   ==================================================== */
#settings-container,
#profile-container {
  width: 100% !important;
  max-width: 1360px !important;
  margin: 0 auto !important;
  padding: 0.25rem 0 2.5rem 0 !important;
}

.settings-header-banner {
  background: linear-gradient(135deg, var(--card-bg), var(--bg-hover, #f8fafc));
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.15rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.settings-modules-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  width: 100%;
}

@media (min-width: 992px) {
  .settings-modules-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: stretch;
  }
  .settings-modules-grid .settings-full-width {
    grid-column: 1 / -1 !important;
  }
}

.settings-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Compact & Responsive Profile Section (All Devices)
   ========================================================================== */
.profile-card-container {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl, 16px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  margin-bottom: 1.15rem;
}

.profile-hero-banner-compact {
  background: var(--theme-banner-gradient, linear-gradient(135deg, #1e3a8a, #3b82f6, #6366f1));
  padding: 1.25rem 1.5rem;
  color: #ffffff;
  position: relative;
}

@media (max-width: 640px) {
  .profile-hero-banner-compact {
    padding: 1rem 0.85rem;
  }
}

.profile-avatar-compact {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  background: #ffffff;
}

@media (max-width: 640px) {
  .profile-avatar-compact {
    width: 56px;
    height: 56px;
    border-width: 2.5px;
  }
}

.profile-details-body {
  padding: 1.15rem 1.25rem;
}

@media (max-width: 640px) {
  .profile-details-body {
    padding: 0.85rem 0.75rem;
  }
}

/* 2-column compact grid for Official Title & Access Level */
.profile-hero-roles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

@media (min-width: 680px) {
  .profile-hero-roles-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
}

.profile-role-compact-card {
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  transition: all 0.2s ease;
}

/* Compact Membership & Jurisdiction Grid */
.profile-info-compact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

@media (min-width: 640px) {
  .profile-info-compact-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
}

@media (min-width: 900px) {
  .profile-info-compact-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
  }
}

.profile-info-tile {
  background: var(--bg-hover, #f8fafc);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 52px;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.profile-info-tile:hover {
  border-color: rgba(99, 102, 241, 0.35);
  background: var(--card-bg, #ffffff);
}

.profile-info-tile-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.profile-info-tile-value {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-color);
  margin-top: 0.15rem;
  word-break: break-word;
  line-height: 1.35;
}

@media (min-width: 900px) {
  .profile-info-tile-club {
    grid-column: span 2;
  }
}

@media (max-width: 639px) {
  .profile-info-tile-club {
    grid-column: 1 / -1;
  }
}

/* Bottom Actions Compact Grid */
.profile-actions-compact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

@media (min-width: 640px) {
  .profile-actions-compact-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.85rem;
  }
}

.profile-action-compact-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.65rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-action-compact-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Universal Sticky Footer & Viewport Polish Across All Resolutions
   ========================================================================== */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-container[style*="display: none"],
.app-container[style*="display:none"],
body.superadmin-active #app-layout,
body.superadmin-active .app-container,
body.superadmin-active header,
body.superadmin-active main,
body.superadmin-active footer,
body.superadmin-active #mobile-bottom-nav {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.superadmin-active #superadmin-dashboard {
  display: block !important;
  visibility: visible !important;
  min-height: 100vh !important;
}

main {
  flex: 1 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 1440px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

footer,
main > footer,
#app-global-footer {
  margin-top: 0.4rem !important;
  width: 100% !important;
  border-top: 1px solid var(--border-color) !important;
  padding: 0.65rem 1rem max(0.65rem, env(safe-area-inset-bottom, 0px)) 1rem !important;
  background: transparent !important;
  box-sizing: border-box !important;
}

@media (min-width: 992px) {
  footer,
  main > footer,
  #app-global-footer {
    margin-top: auto !important;
    padding: 1.25rem 1rem !important;
  }
}

/* Ensure directory-container and sections scale cleanly on ultra-wide & mobile */
.directory-container,
#directory-container {
  width: 100% !important;
  max-width: 1440px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* Explicitly hide circulars messaging wallet badges */
#circulars-email-wallet-badge,
#circulars-whatsapp-wallet-badge,
#circulars-wallet-badge,
.circulars-wallet-indicator {
  display: none !important;
}

/* Option 1: Floating Launcher Icons (Transparent Card Box & Border) */
.module-card,
#app-module-grid .module-card,
.module-launcher-grid .module-card {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.module-card:hover,
#app-module-grid .module-card:hover,
.module-launcher-grid .module-card:hover {
  background: rgba(37, 99, 235, 0.05) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.module-card:active,
#app-module-grid .module-card:active,
.module-launcher-grid .module-card:active {
  background: rgba(37, 99, 235, 0.1) !important;
  transform: translateY(-1px) scale(0.96) !important;
}

.module-card.active,
.module-card:focus-visible,
#app-module-grid .module-card.active,
.module-launcher-grid .module-card.active {
  border-color: transparent !important;
  box-shadow: none !important;
}

/* ==========================================================================
   Multi-Resolution Responsiveness & Fluid Layout Enhancements
   ========================================================================== */

/* 1. Responsive Hierarchy Zones Grid across Region and District views */
.hierarchy-zones-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
  gap: 1rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 640px) {
  .hierarchy-zones-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
}

/* 2. Responsive Subtabs Navigation Grid (Desktop 6 cols, Tablet 3 cols, Mobile 2 cols) */
.subtabs-navigation-grid {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 0.65rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 1100px) {
  .subtabs-navigation-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
  }
}

@media (max-width: 640px) {
  .subtabs-navigation-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.45rem !important;
  }
  .subtabs-navigation-grid button {
    padding: 0.5rem 0.35rem !important;
    font-size: 0.78rem !important;
  }
}

/* 3. Responsive Portal & Section Containers across All Resolutions */
#my-club-container,
#my-zone-container,
#my-region-container,
#my-district-container,
#cabinet-visits-container,
#profile-container,
#settings-container,
.portal-responsive-container {
  width: 100% !important;
  max-width: 1400px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  box-sizing: border-box !important;
}

@media (max-width: 640px) {
  #my-club-container,
  #my-zone-container,
  #my-region-container,
  #my-district-container,
  #cabinet-visits-container,
  #profile-container,
  #settings-container,
  .portal-responsive-container {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
}

/* 4. Ultrawide & High-Resolution Display Launcher Optimization (>= 1440px) */
@media (min-width: 1440px) {
  #app-home-section {
    max-width: 1360px !important;
  }
  .module-launcher-grid {
    max-width: 1360px !important;
  }
}

/* ==========================================================================
   DISTRICT PIN ZOOM LIGHTBOX MODAL
   ========================================================================== */
#modal-district-pin-zoom {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.85) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  z-index: 200200 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#modal-district-pin-zoom.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#modal-district-pin-zoom .modal-district-pin-card {
  position: relative !important;
  width: 100% !important;
  max-width: 440px !important;
  background: var(--card-bg, #ffffff) !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.2) !important;
  overflow: hidden !important;
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#modal-district-pin-zoom.active .modal-district-pin-card {
  transform: scale(1) !important;
}

#header-dual-logo-box:hover #header-district-pin {
  transform: scale(1.08);
}

/* ======================================================== */
/* Responsive Region & Zone & Club Service Impact Reports   */
/* ======================================================== */
.service-regions-table-wrap,
.service-clubs-table-wrap,
.membership-regions-table-wrap,
.membership-clubs-table-wrap {
  display: block;
}
.service-regions-cards-wrap,
.service-clubs-cards-wrap,
.membership-regions-cards-wrap,
.membership-clubs-cards-wrap,
.service-clubs-mobile-sort,
.membership-clubs-mobile-sort {
  display: none !important;
}

@media (max-width: 768px) {
  .service-report-card-container {
    padding: 1rem 0.75rem !important;
  }
  .service-regions-table-wrap,
.service-clubs-table-wrap,
.membership-regions-table-wrap,
.membership-clubs-table-wrap {
    display: none !important;
  }
  .service-regions-cards-wrap,
  .service-clubs-cards-wrap,
  .membership-regions-cards-wrap,
  .membership-clubs-cards-wrap {
    display: flex !important;
    flex-direction: column;
    gap: 0.85rem;
  }
  .service-clubs-mobile-sort,
  .membership-clubs-mobile-sort {
    display: flex !important;
  }
}


/* ====================================================
   LCIF Mobile Responsiveness & Leaderboard Cards
   ==================================================== */
.lcif-clubs-table-wrap {
  display: block;
}
.lcif-clubs-cards-wrap,
.lcif-clubs-mobile-sort {
  display: none !important;
}

@media (max-width: 768px) {
  .lcif-tab-controls-wrap {
    gap: 0.65rem !important;
    margin-bottom: 1.25rem !important;
    border-bottom: none !important;
  }
  .lcif-tab-buttons-container {
    width: 100% !important;
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.4rem !important;
    overflow: visible !important;
    padding: 0 !important;
  }
  .lcif-tab-btn {
    flex: 1 1 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
    padding: 0.45rem 0.25rem !important;
    font-size: 0.74rem !important;
    font-weight: 800 !important;
    border-radius: 99px !important;
    border: 1.5px solid var(--border-color) !important;
    background: var(--card-bg, #ffffff) !important;
    color: var(--text-color) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 0.25rem !important;
    white-space: nowrap !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03) !important;
    transition: all 0.2s ease !important;
  }
  .lcif-tab-btn span.tab-icon {
    font-size: 0.85rem !important;
  }
  .lcif-tab-btn.active {
    background: var(--primary-color, #1e3a8a) !important;
    color: #ffffff !important;
    border-color: var(--primary-color, #1e3a8a) !important;
    box-shadow: 0 3px 10px rgba(30, 58, 138, 0.25) !important;
  }
  .lcif-tab-actions-container {
    justify-content: stretch !important;
    width: 100% !important;
  }
  .lcif-add-btn {
    width: 100% !important;
    justify-content: center !important;
    margin-top: 0.25rem !important;
  }
  .lcif-clubs-table-wrap {
    display: none !important;
  }
  .lcif-clubs-cards-wrap {
    display: flex !important;
    flex-direction: column;
    gap: 0.85rem;
  }
  .lcif-clubs-mobile-sort {
    display: flex !important;
  }

  /* Leadership Attendees Directory Mobile Cards */
  .leadership-attendees-table-wrap {
    display: none !important;
  }
  .leadership-attendees-cards-wrap {
    display: flex !important;
    flex-direction: column;
    gap: 0.75rem;
  }
}

.leadership-attendees-cards-wrap {
  display: none;
}

/* =========================================================
   Event Social Connect / Share Modal (True Fixed Popup)
   ========================================================= */
#modal-event-social-share,
div#modal-event-social-share {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.72) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  z-index: 100060 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  box-sizing: border-box !important;
}

#modal-event-social-share.active,
#modal-event-social-share[style*="display: flex"],
#modal-event-social-share[style*="display: block"],
div#modal-event-social-share.active,
div#modal-event-social-share[style*="display: flex"],
div#modal-event-social-share[style*="display: block"] {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#modal-event-social-share[style*="display: none"],
#modal-event-social-share:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
div#modal-event-social-share[style*="display: none"],
div#modal-event-social-share:not(.active):not([style*="display: flex"]):not([style*="display: block"]) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#modal-event-social-share .modal-content,
div#modal-event-social-share .modal-content {
  position: relative !important;
  width: 100% !important;
  max-width: 520px !important;
  max-height: 90vh !important;
  overflow: hidden !important;
  background: var(--card-bg, #ffffff) !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.5) !important;
  border: 1.5px solid var(--border-color, #e2e8f0) !important;
  margin: auto !important;
  z-index: 100061 !important;
  animation: magicModalPopIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes magicModalPopIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.dyn-letter-p1, .dyn-letter-p2 {
  white-space: pre-wrap !important;
  word-break: break-word !important;
}

/* ====================================================
   District Analytics Base View Toggles & Mobile Cards
   ==================================================== */
.analytics-mobile-swipe-hint {
  display: none;
}

.analytics-view-toggle-grp {
  display: inline-flex;
  align-items: center;
  background: var(--bg-color, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 2px;
}

.analytics-view-btn {
  padding: 0.32rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  user-select: none;
}

.analytics-view-btn.active {
  background: var(--card-bg, #ffffff) !important;
  color: var(--primary-color, #4f46e5) !important;
  font-weight: 800;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.analytics-regions-cards-wrap,
.analytics-clubs-cards-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.analytics-region-card,
.analytics-club-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 0.95rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.analytics-region-card:hover,
.analytics-club-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.06);
}

/* =========================================================
   Service Activity Reporting Responsive Overhauls (Mobile & Small Screens)
   ========================================================= */
.mcw-flagship-card {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.mcw-card-body {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
}

.mcw-photo-col {
  width: 160px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
  box-sizing: border-box;
}

.mcw-fields-col {
  flex: 1 1 280px;
  min-width: 0 !important;
  max-width: 100% !important;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-sizing: border-box;
}

.mcw-row-title {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.mcw-row-dates-cause {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.mcw-impact-grid {
  background: var(--card-bg, #ffffff);
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
  width: 100%;
  box-sizing: border-box;
}

.mcw-flagship-card input,
.mcw-flagship-card select,
.mcw-flagship-card textarea {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  .mcw-flagship-card {
    padding: 0.9rem !important;
    gap: 0.85rem !important;
  }
  .mcw-card-body {
    flex-direction: column !important;
    gap: 1rem !important;
  }
  .mcw-photo-col {
    width: 100% !important;
    align-items: center !important;
  }
  .mcw-photo-preview {
    width: 100% !important;
    max-width: 280px !important;
    height: 140px !important;
  }
  .mcw-photo-col .thumb-grid {
    justify-content: center !important;
  }
  .mcw-fields-col {
    width: 100% !important;
    min-width: 100% !important;
  }
  .mcw-row-title {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }
  .mcw-row-dates-cause {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.6rem !important;
  }
  .mcw-impact-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.55rem !important;
    padding: 0.6rem !important;
  }
}

@media (max-width: 480px) {
  .mcw-row-dates-cause {
    grid-template-columns: 1fr !important;
  }
  .mcw-impact-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Zero-Blank-Space & Section Mutually-Exclusive Display Fixes */
#my-club-container,
#my-zone-container,
#my-region-container,
#my-district-container {
  padding-top: 0.25rem !important;
  margin-top: 0 !important;
}

#my-club-view {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

.lion-hero-banner.lion-hero-club,
.lion-hero-banner.lion-hero-zone,
.lion-hero-banner.lion-hero-region {
  margin-top: 0.25rem !important;
}

/* My Club Sub-Modals Overlay Stacking */
#select-club-modal,
#modal-myclub-member-edit,
#modal-myclub-feehead-edit,
#modal-myclub-bill-create,
#modal-myclub-receipt-create,
#modal-myclub-voucher-create,
#modal-myclub-bank-edit,
#modal-club-dues {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.78) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
  z-index: 100060 !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  display: none;
}

#modal-club-dues.active,
#modal-club-dues[style*="display: flex"],
#modal-club-dues[style*="display: block"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  overflow-y: auto !important;
}

#modal-club-dues .modal-content {
  display: flex !important;
  flex-direction: column !important;
  height: auto !important;
  max-height: 92vh !important;
  min-height: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

#modal-club-dues #club-dues-scroll-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: calc(92vh - 170px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
}

@media (max-width: 768px) {
  #modal-club-dues {
    align-items: flex-start !important;
    padding: 0.5rem !important;
  }
  #modal-club-dues .modal-content {
    max-height: 96vh !important;
  }
  #modal-club-dues #club-dues-scroll-body {
    max-height: calc(96vh - 160px) !important;
  }
}

#select-club-modal:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
#modal-myclub-member-edit:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
#modal-myclub-feehead-edit:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
#modal-myclub-bill-create:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
#modal-myclub-receipt-create:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
#modal-myclub-voucher-create:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
#modal-myclub-bank-edit:not(.active):not([style*="display: flex"]):not([style*="display: block"]),
#modal-club-dues:not(.active):not([style*="display: flex"]):not([style*="display: block"]) {
  display: none !important;
}



