/* ==========================================================================
   망곰베어스 매니저 (Manggom Bears Manager)
   Design System: MyRealTrip (마이리얼트립)
   Clean White #ffffff, Sky Blue #2b96ed, Dark Slate #101418, Ink #495056
   운영진 전용 모임 통합 관리 콘솔 (Admin Operations Console)
   ========================================================================== */

:root {
  /* MyRealTrip Color Tokens (design.md) */
  --tv-canvas: #ffffff;
  --tv-surface-card: #ffffff;
  --tv-surface-raised: #f8f9fa;
  --tv-surface-modal: #ffffff;
  --tv-surface-input: #f5f6f7;
  --tv-surface-overlay: rgba(16, 20, 24, 0.65);
  
  --tv-foreground: #101418;
  --tv-foreground-secondary: #495056;
  --tv-foreground-muted: #666d75;
  
  --tv-hairline: #ced4da;
  --tv-hairline-subtle: #e9ecef;
  
  --tv-primary: #2b96ed;
  --tv-primary-hover: #1d83d6;
  --tv-primary-glow: rgba(43, 150, 237, 0.25);
  
  --tv-accent-blue: #2b96ed;
  --tv-accent-cyan: #00b4d8;
  --tv-accent-green: #10b981;
  --tv-accent-amber: #f59e0b;
  --tv-accent-purple: #8b5cf6;
  --tv-accent-carrot: #ff7e36;

  /* Typography (design.md) */
  --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Noto Sans KR', sans-serif;

  /* Radius (design.md) */
  --radius-menu: 8px;
  --radius-action: 12px;
  --radius-live-pill: 16px;
  --radius-card: 12px;
  --radius-modal: 16px;
  --radius-btn: 12px;

  /* Shadows */
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.16);
  --shadow-dropdown: 0 12px 32px rgba(0, 0, 0, 0.1);
}

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

html {
  font-family: var(--font-family);
  font-size: 13.5px;
  background-color: #f8f9fa;
  color: var(--tv-foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  line-height: 1.5;
  background-color: #f8f9fa;
  color: var(--tv-foreground);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: var(--font-family);
  border: none;
  background: none;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
}

input, textarea, select {
  font-family: var(--font-family);
  outline: none;
  font-size: 14px;
  color: var(--tv-foreground-secondary);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f3f5;
}
::-webkit-scrollbar-thumb {
  background: #ced4da;
  border-radius: var(--radius-menu);
}
::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}

/* ==========================================================================
   App Layout (Sidebar + Main Content)
   ========================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  background-color: #f8f9fa;
}

/* Left MyRealTrip Sidebar */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background-color: #ffffff;
  border-right: 1px solid var(--tv-hairline-subtle);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 100;
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.02);
}

.sidebar-logo-wrap {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--tv-hairline-subtle);
  margin-bottom: 18px;
  cursor: pointer;
}

.sidebar-logo-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--tv-foreground);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-logo-title span {
  color: var(--tv-primary);
}

.sidebar-logo-desc {
  font-size: 11.5px;
  color: var(--tv-foreground-muted);
  margin-top: 4px;
}

.sidebar-menu-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--tv-foreground-muted);
  padding: 10px 8px 4px;
  letter-spacing: 0.5px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-menu);
  color: var(--tv-foreground-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
}

.sidebar-nav-item:hover {
  background-color: #f1f3f5;
  color: var(--tv-foreground);
}

.sidebar-nav-item.active {
  background-color: rgba(43, 150, 237, 0.08);
  color: var(--tv-primary);
  font-weight: 700;
  border-left: 3px solid var(--tv-primary);
}

/* Sidebar Subtrees (Always Open) */
.sidebar-sub-menu {
  display: flex !important;
  flex-direction: column;
  gap: 2px;
  padding-left: 14px;
  margin: 4px 0 8px;
}

.sidebar-sub-item {
  padding: 7px 10px;
  border-radius: var(--radius-menu);
  font-size: 12.5px;
  color: var(--tv-foreground-muted);
  cursor: pointer;
  transition: all 0.12s ease;
  background-color: transparent;
  font-weight: 500;
}

.sidebar-sub-item:hover {
  color: var(--tv-foreground);
  background-color: #f1f3f5;
}

.sidebar-sub-item.active {
  color: var(--tv-primary) !important;
  font-weight: 700 !important;
  background-color: rgba(43, 150, 237, 0.08) !important;
}

.sidebar-bottom-box {
  background-color: #f8f9fa;
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-menu);
  padding: 12px;
  font-size: 11.5px;
  color: var(--tv-foreground-secondary);
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  min-width: 0;
  padding: 24px 32px 60px;
  background-color: #f8f9fa;
}

.top-utility-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #ffffff;
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-card);
  padding: 14px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.view-page-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--tv-foreground);
}

.utility-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   Buttons & Controls (MyRealTrip design.md)
   ========================================================================== */
.btn-primary {
  background-color: var(--tv-primary);
  color: #ffffff;
  border-radius: var(--radius-btn);
  padding: 0 24px;
  height: 40px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(43, 150, 237, 0.25);
  transition: background-color 0.12s ease, transform 0.1s ease, box-shadow 0.12s ease;
}

.btn-primary:hover {
  background-color: var(--tv-primary-hover);
  box-shadow: 0 4px 10px rgba(43, 150, 237, 0.35);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-trigger {
  background-color: #ffffff;
  color: var(--tv-foreground-secondary);
  border: 1px solid var(--tv-hairline);
  border-radius: var(--radius-btn);
  padding: 0 18px;
  height: 40px;
  font-size: 13.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

.btn-trigger:hover {
  border-color: var(--tv-primary);
  color: var(--tv-primary);
  background-color: rgba(43, 150, 237, 0.04);
}

.btn-ghost {
  background-color: transparent;
  color: var(--tv-foreground-secondary);
  border: 1px solid var(--tv-hairline);
  border-radius: var(--radius-menu);
  padding: 0 12px;
  height: 32px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

.btn-ghost:hover {
  border-color: var(--tv-primary);
  color: var(--tv-primary);
  background-color: rgba(43, 150, 237, 0.04);
}

.btn-danger {
  background-color: #fff1f2;
  color: #e11d48;
  border: 1px solid #fda4af;
  border-radius: var(--radius-menu);
  padding: 0 12px;
  height: 32px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

.btn-danger:hover {
  background-color: #e11d48;
  color: #ffffff;
  border-color: #e11d48;
}

/* ==========================================================================
   Interactive Chips & Badges
   ========================================================================== */
.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #ffffff;
  border: 1px solid var(--tv-hairline);
  border-radius: var(--radius-live-pill);
  color: var(--tv-foreground-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: all 0.12s ease;
}

.member-chip:hover {
  border-color: var(--tv-primary);
  color: var(--tv-primary);
  background: rgba(43, 150, 237, 0.04);
}

.member-chip.selected {
  background: rgba(43, 150, 237, 0.12);
  border-color: var(--tv-primary);
  color: var(--tv-primary);
  font-weight: 700;
  box-shadow: 0 0 8px rgba(43, 150, 237, 0.2);
}

.member-chip.selected-cyan {
  background: rgba(0, 180, 216, 0.12);
  border-color: var(--tv-accent-cyan);
  color: #0077b6;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(0, 180, 216, 0.2);
}

.member-chip.exempt-chip {
  background: rgba(245, 158, 11, 0.12);
  border-color: var(--tv-accent-amber);
  color: #d97706;
  font-weight: 700;
}

/* Big Selector Chip (Gender, Source) */
.big-select-chip {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  background: var(--tv-surface-input);
  border: 1px solid var(--tv-hairline);
  border-radius: var(--radius-menu);
  color: var(--tv-foreground-secondary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.big-select-chip:hover {
  border-color: var(--tv-primary);
  color: var(--tv-primary);
  background: #ffffff;
}

.big-select-chip.active {
  background: rgba(43, 150, 237, 0.12);
  border-color: var(--tv-primary);
  color: var(--tv-primary);
  font-weight: 800;
  box-shadow: 0 0 8px rgba(43, 150, 237, 0.2);
}

/* Residence Chip Picker Box */
.residence-picker-box {
  background: var(--tv-surface-input);
  border: 1px solid var(--tv-hairline);
  border-radius: var(--radius-card);
  padding: 12px;
  max-height: 180px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.residence-category-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--tv-foreground-muted);
  margin-bottom: 6px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.residence-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: var(--radius-menu);
  font-size: 12.5px;
  background: #ffffff;
  border: 1px solid var(--tv-hairline-subtle);
  color: var(--tv-foreground-secondary);
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
}

.residence-chip:hover {
  border-color: var(--tv-primary);
  color: var(--tv-primary);
}

.residence-chip.selected {
  background: var(--tv-primary);
  border-color: var(--tv-primary);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(43, 150, 237, 0.3);
}

/* ==========================================================================
   Live Pill Tabs (MyRealTrip: #101418 dark selected pill, 16px radius)
   ========================================================================== */
.live-tab-bar, .live-pill-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}

.live-pill-tab {
  background-color: var(--tv-surface-input);
  color: var(--tv-foreground-muted);
  border: 1px solid var(--tv-hairline);
  border-radius: var(--radius-live-pill);
  padding: 7px 15px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.live-pill-tab:hover {
  border-color: var(--tv-primary);
  color: var(--tv-primary);
}

.live-pill-tab.active {
  background-color: #101418;
  color: #ffffff;
  border: 1px solid #101418;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(16, 20, 24, 0.2);
}

/* ==========================================================================
   Cards & Layout Components (MyRealTrip: #ffffff surface, #e9ecef border)
   ========================================================================== */
.tv-card {
  background-color: var(--tv-surface-card);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--tv-hairline-subtle);
}

.card-heading-title {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--tv-foreground);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Admin Alert Box */
.admin-alert-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-menu);
  padding: 12px 16px;
  margin-bottom: 10px;
}

.admin-alert-box.danger {
  background: #fff1f2;
  border-color: #fda4af;
}

.admin-alert-box.info {
  background: rgba(43, 150, 237, 0.08);
  border-color: rgba(43, 150, 237, 0.3);
}

/* Dashboard Top Hero Row (Banner + Metrics) */
.dashboard-top-hero-row {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 16px;
  margin-bottom: 22px;
  align-items: stretch;
}

.dashboard-banner-box {
  background-color: var(--tv-surface-card);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 190px;
}

.dashboard-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: calc(var(--radius-card) - 1px);
  transition: transform 0.25s ease;
}

.dashboard-banner-box:hover .dashboard-banner-img {
  transform: scale(1.015);
}

.dashboard-top-hero-row .metric-stats-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 0;
  height: 100%;
}

.metric-card-box {
  background-color: var(--tv-surface-card);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.metric-card-label {
  font-size: 12px;
  color: var(--tv-foreground-muted);
  margin-bottom: 4px;
  font-weight: 500;
}

.metric-card-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--tv-foreground);
}

/* ==========================================================================
   SCHEDULE & MEETUP STYLES (직관 / 뒷풀이 / 기타 벙)
   ========================================================================== */
.meetup-filter-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background-color: var(--tv-surface-card);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-card);
  padding: 14px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.meetup-filter-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.meetup-summary-card {
  background-color: var(--tv-surface-card);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.meetup-summary-card:hover {
  border-color: var(--tv-primary);
  box-shadow: 0 4px 14px rgba(43, 150, 237, 0.12);
}

.meetup-summary-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meetup-summary-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--tv-foreground);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meetup-summary-meta {
  font-size: 13px;
  color: var(--tv-foreground-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.meetup-summary-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Seat Block Row Cards */
.block-card-tv {
  background: var(--tv-surface-input);
  border: 1px solid var(--tv-hairline);
  border-radius: var(--radius-menu);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.block-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.block-badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: rgba(43, 150, 237, 0.1);
  border: 1px solid rgba(43, 150, 237, 0.3);
  color: var(--tv-primary);
  border-radius: var(--radius-menu);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Member Picker (ETC 벙) */
.member-picker-box {
  background: var(--tv-surface-input);
  border: 1px solid var(--tv-hairline);
  border-radius: var(--radius-menu);
  padding: 12px;
}

.member-picker-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.member-picker-search {
  flex-grow: 1;
  height: 34px;
  background: #ffffff;
  border: 1px solid var(--tv-hairline);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--tv-foreground);
}

.member-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.member-pick-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--tv-foreground-secondary);
  cursor: pointer;
}

.member-pick-item:hover {
  background: #f1f3f5;
  color: var(--tv-foreground);
  border-color: var(--tv-primary);
}

/* ==========================================================================
   INTERACTIVE DUAL-COLUMN RELATION BRIDGE (관계도 파악)
   ========================================================================== */
.relation-bridge-stage {
  display: grid !important;
  grid-template-columns: 280px 1fr 280px !important;
  gap: 0;
  background: #ffffff;
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-card);
  height: 520px;
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  box-shadow: var(--shadow-card);
}

.bridge-column {
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

.bridge-column.left-col {
  border-right: 1px solid var(--tv-hairline-subtle);
}

.bridge-column.right-col {
  border-left: 1px solid var(--tv-hairline-subtle);
}

.bridge-column-header {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--tv-foreground);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 20;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--tv-hairline-subtle);
}

.member-bridge-card {
  background: #ffffff;
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-menu);
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
  position: relative;
}

.member-bridge-card:hover {
  background: #f8f9fa;
  border-color: var(--tv-primary);
}

.member-bridge-card.active-source {
  background: rgba(43, 150, 237, 0.08);
  border: 2px solid var(--tv-primary);
  box-shadow: 0 0 12px rgba(43, 150, 237, 0.25);
}

.member-bridge-card.connected-friend {
  border-color: var(--tv-primary);
  background: rgba(43, 150, 237, 0.06);
}

.member-bridge-card.connected-coseat {
  border-color: var(--tv-accent-cyan);
  background: rgba(0, 180, 216, 0.06);
}

.member-bridge-card.connected-other {
  border-color: var(--tv-hairline);
  background: #f8f9fa;
}

.member-bridge-card.dimmed-target {
  opacity: 0.35;
}

.bridge-svg-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(43, 150, 237, 0.03) 0%, transparent 70%);
}

#relationSvgCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.connection-curve {
  transition: stroke-width 0.2s ease, opacity 0.2s ease;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.15));
}

/* ==========================================================================
   CREATIVE CUSTOM INFOGRAPHIC CHARTS & VISUALIZATIONS
   ========================================================================== */
.stat-infographic-card {
  background: var(--tv-surface-card);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-card);
  padding: 20px;
  position: relative;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.stat-infographic-card:hover {
  border-color: var(--tv-primary);
  box-shadow: 0 4px 14px rgba(43, 150, 237, 0.08);
}

.stat-card-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--tv-foreground);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

/* MBTI 4-Dimension Dual Meter */
.mbti-dim-row {
  display: grid;
  grid-template-columns: 45px 1fr 45px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.mbti-dim-label-left {
  text-align: right;
  font-weight: 800;
  font-size: 13px;
  color: var(--tv-primary);
}

.mbti-dim-label-right {
  text-align: left;
  font-weight: 800;
  font-size: 13px;
  color: #10b981;
}

.mbti-dual-track {
  display: flex;
  height: 12px;
  background: var(--tv-surface-input);
  border: 1px solid var(--tv-hairline);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.mbti-bar-left {
  background: linear-gradient(90deg, #2b96ed, #60a5fa);
  height: 100%;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mbti-bar-right {
  background: linear-gradient(90deg, #10b981, #34d399);
  height: 100%;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 16 MBTI Interactive Grid */
.mbti-grid-16 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 14px;
}

.mbti-tile-btn {
  background: var(--tv-surface-input);
  border: 1px solid var(--tv-hairline);
  border-radius: var(--radius-menu);
  padding: 8px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.mbti-tile-btn:hover {
  background: #ffffff;
  border-color: var(--tv-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(43, 150, 237, 0.15);
}

.mbti-tile-btn.active {
  background: rgba(43, 150, 237, 0.12);
  border-color: var(--tv-primary);
  box-shadow: 0 0 10px rgba(43, 150, 237, 0.25);
}

.mbti-tile-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--tv-foreground);
}

.mbti-tile-count {
  font-size: 11px;
  color: var(--tv-foreground-muted);
  margin-top: 2px;
}

.mbti-tile-count.has-members {
  color: var(--tv-primary);
  font-weight: 700;
}

/* Birth Year Clean Bar Chart (Fixed X-Axis) */
.birth-chart-container {
  display: flex;
  flex-direction: column;
  height: 190px;
  padding: 10px 0 0;
}

.birth-chart-bars {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  align-items: flex-end;
  height: 140px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--tv-hairline-subtle);
}

.birth-bar-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
  cursor: pointer;
}

.birth-bar-val {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--tv-foreground);
  min-height: 16px;
  line-height: 16px;
  transition: color 0.15s ease;
}

.birth-bar-fill {
  width: 100%;
  max-width: 28px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #2b96ed 0%, #1d4ed8 100%);
  box-shadow: 0 2px 8px rgba(43, 150, 237, 0.25);
  transition: height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.15s ease, transform 0.15s ease;
}

.birth-bar-fill.zero {
  background: var(--tv-surface-input);
  border: 1px dashed var(--tv-hairline);
  box-shadow: none;
  min-height: 4px;
}

.birth-bar-column:hover .birth-bar-fill {
  filter: brightness(1.15);
  transform: translateY(-2px);
}

.birth-bar-column:hover .birth-bar-val {
  color: var(--tv-primary);
}

.birth-chart-xaxis {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  padding-top: 8px;
}

.birth-xaxis-label {
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--tv-foreground-muted);
  user-select: none;
}

/* Ticket Stub Design for Pre-ticket Card */
.ticket-grid-wrap {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.kbo-ticket-stub {
  background: #ffffff;
  border: 1px solid var(--tv-hairline);
  border-radius: var(--radius-menu);
  padding: 12px;
  position: relative;
  cursor: pointer;
  transition: all 0.15s ease;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.kbo-ticket-stub::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f8f9fa;
  border-right: 1px solid var(--tv-hairline);
}

.kbo-ticket-stub::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f8f9fa;
  border-left: 1px solid var(--tv-hairline);
}

.kbo-ticket-stub:hover {
  border-color: var(--tv-primary);
  background: #f0f7ff;
  transform: translateY(-2px);
}

.kbo-ticket-stub.highlight {
  border-color: var(--tv-primary);
  box-shadow: 0 0 12px rgba(43, 150, 237, 0.25);
  background: rgba(43, 150, 237, 0.08);
}

/* Interactive SVG Donut Chart */
.donut-chart-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 200px;
}

.join-source-legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 600px) {
  .join-source-legend-grid {
    grid-template-columns: 1fr;
  }
}

.donut-center-info {
  position: absolute;
  text-align: center;
  pointer-events: none;
}

.donut-slice {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
  transform-origin: center;
}

.donut-slice:hover {
  opacity: 0.92;
  transform: scale(1.04);
}

/* Interactive Floating Tooltip */
.chart-floating-tooltip {
  position: absolute;
  background: #101418;
  border: 1px solid #2b96ed;
  border-radius: 8px;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 12.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.chart-floating-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Monthly Trend Bar Grid (Interactive with hover) */
.monthly-trend-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  align-items: flex-end;
  height: 180px;
  padding: 10px 0 28px;
  border-bottom: 1px solid var(--tv-hairline-subtle);
  position: relative;
}

.trend-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  cursor: pointer;
  padding: 0 2px;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.trend-bar-group:hover {
  background: rgba(43, 150, 237, 0.06);
}

.trend-bar-subgroup {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  width: 100%;
  height: 140px;
  justify-content: center;
}

.trend-bar-pill {
  width: 13px;
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease, filter 0.15s ease;
  position: relative;
}

.trend-bar-pill.join {
  background: var(--tv-primary);
  box-shadow: 0 0 6px rgba(43, 150, 237, 0.35);
}

.trend-bar-pill.leave {
  background: #adb5bd;
}

.trend-bar-group:hover .trend-bar-pill {
  filter: brightness(1.15);
}

.trend-month-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--tv-foreground-muted);
  position: absolute;
  bottom: -22px;
}

/* Ranking Podium Cards */
.ranking-podium-card {
  background: var(--tv-surface-card);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-menu);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-card);
  transition: all 0.15s ease;
}

.ranking-podium-card:hover {
  border-color: var(--tv-primary);
  background: #f0f7ff;
  transform: translateX(3px);
}

.rank-badge-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  flex-shrink: 0;
}

.rank-badge-1 {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: #000000;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.rank-badge-2 {
  background: linear-gradient(135deg, #e0e0e0, #a0a0a0);
  color: #000000;
}

.rank-badge-3 {
  background: linear-gradient(135deg, #cd7f32, #8b4513);
  color: #ffffff;
}

.rank-badge-low {
  background: rgba(43, 150, 237, 0.12);
  border: 1px solid var(--tv-primary);
  color: var(--tv-primary);
}

/* ==========================================================================
   Data Table (MyRealTrip: #ffffff surface, #f8f9fa thead, #495056 ink)
   ========================================================================== */
.tv-table-container {
  background-color: var(--tv-surface-card);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-card);
  overflow-x: auto;
  box-shadow: var(--shadow-card);
}

.tv-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.tv-table th {
  background-color: #f8f9fa;
  color: var(--tv-foreground-secondary);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--tv-hairline);
  white-space: nowrap;
}

.tv-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f3f5;
  color: var(--tv-foreground);
}

.tv-table tr:last-child td {
  border-bottom: none;
}

.tv-table tr:hover td {
  background-color: #f8f9fa;
}

/* Highlight row animation */
@keyframes rowPulse {
  0% { background-color: rgba(43, 150, 237, 0.25); }
  50% { background-color: rgba(43, 150, 237, 0.1); }
  100% { background-color: transparent; }
}

.new-row-highlight td {
  animation: rowPulse 2.5s ease-out;
}

/* Calendar Grid */
.cal-grid-wrap {
  background-color: var(--tv-surface-card);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: var(--tv-hairline-subtle);
}

.cal-head-cell {
  background-color: #f8f9fa;
  padding: 10px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--tv-foreground-secondary);
}

.cal-cell {
  background-color: #ffffff;
  min-height: 105px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.cal-cell:hover {
  background-color: #f8f9fa;
}

.cal-cell.other-month {
  background-color: #fbfcfd;
  opacity: 0.5;
}

.cal-date-number {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--tv-foreground);
}

.cal-kbo-badge {
  background-color: #f1f3f5;
  border: 1px solid var(--tv-hairline);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--tv-foreground);
  display: flex;
  justify-content: space-between;
}

.cal-kbo-badge.home {
  border-color: rgba(43, 150, 237, 0.4);
  color: #1d83d6;
  background-color: rgba(43, 150, 237, 0.12);
}

.cal-event-tag {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-event-tag.jigwan {
  background-color: rgba(43, 150, 237, 0.12);
  color: #1d83d6;
  border: 1px solid rgba(43, 150, 237, 0.35);
}

.cal-event-tag.afterparty {
  background-color: #f1f3f5;
  color: #101418;
  border: 1px solid var(--tv-hairline);
}

/* Dues Matrix */
.dues-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 26px;
  border-radius: var(--radius-menu);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all 0.1s ease;
}

.dues-toggle-btn.paid {
  background-color: rgba(43, 150, 237, 0.12);
  color: var(--tv-primary);
  border: 1px solid var(--tv-primary);
}

.dues-toggle-btn.unpaid {
  background-color: #f8f9fa;
  color: var(--tv-foreground-muted);
  border: 1px solid var(--tv-hairline);
}

.dues-toggle-btn.exempt {
  background-color: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Modals (MyRealTrip: #ffffff surface, #ced4da border, 16px radius) */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--tv-surface-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  backdrop-filter: blur(6px);
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background-color: var(--tv-surface-modal);
  border-radius: var(--radius-modal);
  border: 1px solid var(--tv-hairline);
  width: 90%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  box-shadow: var(--shadow-modal);
  transform: translateY(8px);
  transition: transform 0.15s ease;
}

.modal-backdrop.open .modal-box {
  transform: translateY(0);
}

/* Custom Dialog Box */
.dialog-box {
  background-color: var(--tv-surface-modal);
  border: 1px solid var(--tv-hairline);
  border-radius: var(--radius-modal);
  width: 92%;
  max-width: 440px;
  box-sizing: border-box;
  padding: 22px 24px;
  box-shadow: var(--shadow-modal);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.18s ease;
  display: flex;
  flex-direction: column;
}

.modal-backdrop.open .dialog-box {
  transform: translateY(0) scale(1);
}

.dialog-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--tv-hairline-subtle);
  margin-bottom: 16px;
}

.dialog-title-text {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--tv-foreground);
  letter-spacing: -0.2px;
}

.dialog-message-content {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--tv-foreground-secondary);
  margin-bottom: 20px;
  white-space: pre-wrap;
  word-break: keep-all;
  background: var(--tv-surface-input);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-menu);
  padding: 14px 16px;
}

.dialog-actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: auto;
}

.member-phone-text {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--tv-foreground);
  letter-spacing: 0.3px;
}

.modal-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--tv-hairline-subtle);
  margin-bottom: 16px;
}

.modal-title-text {
  font-size: 17px;
  font-weight: 800;
  color: var(--tv-foreground);
}

.modal-close-icon {
  font-size: 18px;
  color: var(--tv-foreground-muted);
  cursor: pointer;
  transition: color 0.12s ease;
}

.modal-close-icon:hover {
  color: var(--tv-foreground);
}

/* Form groups */
.form-group-tv {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-label-tv {
  font-size: 13px;
  font-weight: 700;
  color: var(--tv-foreground-secondary);
}

.form-control-tv {
  width: 100%;
  height: 40px;
  background-color: var(--tv-surface-input);
  border: 1px solid var(--tv-hairline);
  border-radius: var(--radius-menu);
  padding: 0 14px;
  font-size: 14px;
  color: var(--tv-foreground-secondary);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.form-control-tv:focus {
  border-color: var(--tv-primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(43, 150, 237, 0.15);
}

/* Custom Dropdown (MyRealTrip: #f5f6f7 bg, #ced4da border) */
.tv-custom-select {
  position: relative;
  display: inline-block;
  min-width: 130px;
}

.tv-select-trigger {
  width: 100%;
  height: 40px;
  background-color: var(--tv-surface-input);
  border: 1px solid var(--tv-hairline);
  border-radius: var(--radius-menu);
  padding: 0 14px;
  font-size: 14px;
  color: var(--tv-foreground-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.tv-select-trigger:hover, .tv-select-trigger.active {
  border-color: var(--tv-primary);
  background-color: #ffffff;
}

.tv-select-options-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1px solid var(--tv-hairline);
  border-radius: var(--radius-menu);
  box-shadow: var(--shadow-dropdown);
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 1000;
  display: none;
}

.tv-select-options-list.show {
  display: block;
}

.tv-select-option {
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--tv-foreground-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tv-select-option:hover {
  background-color: #f8f9fa;
  color: var(--tv-foreground);
}

.tv-select-option.selected {
  background-color: rgba(43, 150, 237, 0.1);
  color: var(--tv-primary);
  font-weight: 700;
}

/* Toast */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #101418;
  border: 1px solid #101418;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-menu);
  font-size: 13.5px;
  font-weight: 600;
  z-index: 3000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.15s ease;
  pointer-events: none;
}

.toast-notice.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Custom Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-red {
  background-color: var(--tv-primary);
  color: #ffffff;
}

.badge-red-tint {
  background-color: rgba(43, 150, 237, 0.12);
  color: var(--tv-primary);
  border: 1px solid rgba(43, 150, 237, 0.35);
}

.badge-cyan-tint {
  background-color: rgba(0, 180, 216, 0.12);
  color: #0077b6;
  border: 1px solid rgba(0, 180, 216, 0.35);
}

.badge-white {
  background-color: #f1f3f5;
  color: var(--tv-foreground);
  border: 1px solid var(--tv-hairline);
}

.badge-gray {
  background-color: #f8f9fa;
  color: var(--tv-foreground-secondary);
  border: 1px solid var(--tv-hairline);
}

.badge-green {
  background-color: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-amber {
  background-color: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* App Views & Subviews */
.app-view {
  display: none;
}

.app-view.active-view {
  display: block;
  animation: fadeIn 0.12s ease-in-out;
}

.member-subview, .analytics-subview {
  display: none;
}

.member-subview.active-subview, .analytics-subview.active-subview {
  display: block;
  animation: fadeIn 0.12s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Template Notice Cards & Grid */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.template-card {
  background-color: var(--tv-surface-card);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-card);
  padding: 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.template-card:hover {
  border-color: var(--tv-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(43, 150, 237, 0.1);
}

.template-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.template-card-title {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--tv-foreground);
  word-break: keep-all;
}

.template-card-body {
  background-color: var(--tv-surface-input);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-menu);
  padding: 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--tv-foreground-secondary);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 190px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-bottom: 14px;
  font-family: var(--font-family);
}

.template-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 6px;
}

.variable-chip {
  background-color: #ffffff;
  border: 1px solid var(--tv-hairline);
  color: var(--tv-foreground-secondary);
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.variable-chip:hover {
  border-color: var(--tv-primary);
  color: var(--tv-primary);
  background-color: rgba(43, 150, 237, 0.08);
}

/* ==========================================================================
   Mobile Navigation & Drawer & Bottom Bar
   ========================================================================== */
.mobile-top-header {
  display: none;
}

.mobile-bottom-nav {
  display: none;
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 20, 24, 0.5);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  backdrop-filter: blur(4px);
}

.mobile-drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 290px;
  max-width: 86vw;
  background: #ffffff;
  border-right: 1px solid var(--tv-hairline-subtle);
  z-index: 1201;
  transform: translateX(-100%);
  transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.12);
}

.mobile-drawer-panel.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--tv-hairline-subtle);
  margin-bottom: 12px;
}

.mobile-drawer-menu-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drawer-nav-item {
  padding: 10px 14px;
  border-radius: var(--radius-menu);
  color: var(--tv-foreground);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.drawer-nav-item:hover, .drawer-nav-item.active {
  background-color: rgba(43, 150, 237, 0.08);
  color: var(--tv-primary);
  font-weight: 700;
}

.drawer-nav-group-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--tv-foreground-muted);
  margin: 12px 0 4px 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.drawer-sub-item {
  padding: 8px 14px 8px 20px;
  border-radius: var(--radius-menu);
  font-size: 12.5px;
  color: var(--tv-foreground-secondary);
  cursor: pointer;
  transition: all 0.12s ease;
}

.drawer-sub-item:hover, .drawer-sub-item.active {
  background-color: #f1f3f5;
  color: var(--tv-foreground);
  font-weight: 600;
}

.mobile-icon-btn {
  background: transparent;
  border: none;
  color: var(--tv-foreground);
  font-size: 18px;
  cursor: pointer;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-menu);
}

.mobile-header-brand {
  font-size: 16px;
  font-weight: 800;
  color: var(--tv-foreground);
  letter-spacing: -0.3px;
  cursor: pointer;
}

.mobile-header-brand span {
  color: var(--tv-primary);
}

/* Default Desktop/Mobile Toggle Helpers */
.desktop-member-table-wrap { display: block; }
.mobile-member-card-list { display: none; }
.desktop-activity-table-wrap { display: block; }
.mobile-activity-card-list { display: none; }
.desktop-relation-bridge-wrap { display: block; }
.mobile-relation-bridge-view { display: none; }
.desktop-dues-table-wrap { display: block; }
.mobile-dues-view { display: none; }

/* ==========================================================================
   Mobile Custom Cards & View Layouts
   ========================================================================== */
.member-mobile-card {
  background-color: var(--tv-surface-card);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.12s;
}

.member-mobile-card:hover {
  border-color: var(--tv-primary);
}

.member-mobile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.member-mobile-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 12.5px;
  background-color: var(--tv-surface-input);
  border-radius: var(--radius-menu);
  padding: 10px 12px;
  border: 1px solid var(--tv-hairline-subtle);
}

.member-mobile-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.member-mobile-card-label {
  color: var(--tv-foreground-muted);
  font-size: 11px;
}

.member-mobile-card-val {
  color: var(--tv-foreground);
  font-weight: 600;
  text-align: right;
}

.member-mobile-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 2px;
}

/* Mobile Activity Card */
.activity-mobile-card {
  background-color: var(--tv-surface-card);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-card);
}

/* Mobile Relation Bridge Stream */
.mobile-relation-bridge-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-source-selector {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.mobile-source-chip {
  padding: 8px 14px;
  border-radius: var(--radius-live-pill);
  background-color: var(--tv-surface-card);
  border: 1px solid var(--tv-hairline);
  color: var(--tv-foreground-secondary);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

.mobile-source-chip.selected {
  background-color: var(--tv-primary);
  border-color: var(--tv-primary);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(43, 150, 237, 0.35);
}

.mobile-relation-section {
  background-color: var(--tv-surface-card);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.mobile-relation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background-color: var(--tv-surface-input);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-menu);
  margin-bottom: 8px;
}

/* Mobile Dues Matrix / View */
.mobile-dues-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mobile-month-selector {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.mobile-month-btn {
  padding: 6px 12px;
  border-radius: var(--radius-live-pill);
  background-color: var(--tv-surface-card);
  border: 1px solid var(--tv-hairline);
  color: var(--tv-foreground-secondary);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-month-btn.selected {
  background-color: #101418;
  border-color: #101418;
  color: #ffffff;
  font-weight: 800;
}

.mobile-dues-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background-color: var(--tv-surface-input);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-menu);
  margin-bottom: 6px;
}

/* Mobile Calendar Sheet */
.mobile-calendar-sheet {
  background-color: var(--tv-surface-card);
  border: 1px solid var(--tv-hairline-subtle);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-top: 14px;
  box-shadow: var(--shadow-card);
  animation: fadeIn 0.15s ease-out;
}

/* ==========================================================================
   Grid Utility Classes (Global)
   ========================================================================== */
.modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 12px;
}

.modal-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 12px;
}

.modal-grid-chips-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.analytics-grid-three {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
}

.activity-action-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}

/* ==========================================================================
   Responsive Breakpoints & Media Queries (Mobile / Tablet < 900px)
   ========================================================================== */
@media (max-width: 900px) {
  .app-sidebar,
  .sidebar {
    display: none !important;
  }

  .app-layout {
    flex-direction: column !important;
  }

  .mobile-top-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    height: 54px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--tv-hairline-subtle);
    position: sticky;
    top: 0;
    z-index: 900;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  }

  /* Modern Glassmorphic Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--tv-hairline-subtle);
    z-index: 900;
    align-items: center;
    justify-content: space-around;
    padding: 0 6px calc(env(safe-area-inset-bottom, 0px) + 2px);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(16px);
  }

  .mobile-tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--tv-foreground-muted);
    padding: 6px 0;
    cursor: pointer;
    transition: all 0.15s ease;
    gap: 3px;
    border-radius: 8px;
  }

  .mobile-tab-svg {
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.15s ease;
  }

  .mobile-tab-btn.active {
    color: var(--tv-primary);
  }

  .mobile-tab-btn.active .mobile-tab-svg {
    transform: scale(1.12) translateY(-1px);
    stroke: var(--tv-primary);
    filter: drop-shadow(0 0 6px rgba(43, 150, 237, 0.4));
  }

  .mobile-tab-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: -0.2px;
  }

  .mobile-tab-btn.active .mobile-tab-label {
    font-weight: 800;
  }

  .main-content {
    padding: 14px 14px 80px !important;
  }

  .top-utility-bar {
    display: none !important;
  }

  .dashboard-top-hero-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }

  .dashboard-banner-box {
    width: 100% !important;
    aspect-ratio: 1024 / 539 !important;
    min-height: auto !important;
    height: auto !important;
    border-radius: 12px !important;
  }

  .dashboard-top-hero-row .metric-stats-strip {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 0 !important;
  }

  .metric-stats-strip {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  .dash-action-grid,
  .activity-action-grid,
  .analytics-grid-three {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Member List Tabs on Mobile - No scroll, fit in 1 row */
  .live-tab-bar {
    display: flex !important;
    gap: 4px !important;
    width: 100% !important;
    margin-bottom: 14px !important;
    overflow-x: hidden !important;
  }

  .live-pill-tab {
    flex: 1 1 0 !important;
    padding: 8px 4px !important;
    font-size: 12px !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Meetup Summary Cards on Mobile */
  .meetup-summary-card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .meetup-summary-right {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .meetup-summary-right button {
    flex: 1 1 calc(50% - 6px) !important;
    padding: 8px 10px !important;
    font-size: 12px !important;
  }

  .meetup-filter-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .meetup-filter-left {
    flex-wrap: wrap !important;
    width: 100% !important;
  }

  .meetup-filter-left input,
  .meetup-filter-left select {
    flex: 1 1 100% !important;
    width: 100% !important;
  }

  /* Analytics Grid Stacking on Mobile */
  #subview-analytics-members > div,
  #subview-analytics-ops > div {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .mbti-hub-flex {
    flex-direction: column !important;
    gap: 14px !important;
  }

  .mobile-header-action-btn {
    height: 34px !important;
    min-width: 64px !important;
    padding: 0 12px !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    border-radius: var(--radius-btn) !important;
  }

  .chart-responsive-box {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    width: 100% !important;
  }

  /* Monthly Trend Chart Mobile Fit */
  .monthly-trend-grid {
    gap: 2px !important;
    padding: 10px 0 0 !important;
    height: 140px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-bottom: 1px solid var(--tv-hairline-subtle) !important;
    margin-bottom: 26px !important;
    position: relative !important;
  }

  .trend-bar-group {
    padding: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-end !important;
    position: relative !important;
  }

  .trend-bar-subgroup {
    gap: 2px !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
  }

  .trend-bar-pill {
    width: 100% !important;
    max-width: 8px !important;
    min-width: 3px !important;
    border-radius: 2px 2px 0 0 !important;
  }

  .trend-month-label {
    font-size: 9.5px !important;
    font-weight: 700 !important;
    color: var(--tv-foreground-muted) !important;
    position: absolute !important;
    bottom: -20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    white-space: nowrap !important;
  }

  /* Perfect Proportional Mobile Calendar Cells */
  .cal-cell {
    min-height: 58px !important;
    height: 58px !important;
    padding: 3px 2px !important;
    gap: 2px !important;
    overflow: hidden !important;
  }

  .cal-date-number {
    font-size: 11px !important;
    line-height: 1 !important;
    margin-bottom: 1px !important;
  }

  .cal-kbo-badge {
    font-size: 8.5px !important;
    padding: 1px 2px !important;
    line-height: 1.1 !important;
    max-height: 14px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .cal-kbo-badge span:last-child {
    display: none !important;
  }

  .cal-event-tag {
    font-size: 8.5px !important;
    padding: 1px 2px !important;
    line-height: 1.1 !important;
    max-height: 13px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Responsive Display Switch */
  .desktop-member-table-wrap { display: none !important; }
  .mobile-member-card-list { display: flex !important; flex-direction: column; gap: 12px; }

  .desktop-activity-table-wrap { display: none !important; }
  .mobile-activity-card-list { display: flex !important; flex-direction: column; gap: 12px; }

  .desktop-relation-bridge-wrap { display: none !important; }
  .mobile-relation-bridge-view { display: flex !important; }

  .desktop-dues-table-wrap { display: none !important; }
  .mobile-dues-view { display: flex !important; }

  /* All Modals & Alert Dialogs on Mobile (Auto Resizing to viewport) */
  .modal-backdrop {
    padding: 12px !important;
    box-sizing: border-box !important;
  }

  .modal-box,
  .dialog-box,
  .modal-dialog-card {
    width: 100% !important;
    max-width: calc(100vw - 24px) !important;
    max-height: 88vh !important;
    padding: 20px 18px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    border-radius: var(--radius-modal) !important;
  }

  .dialog-header-bar {
    margin-bottom: 12px !important;
    padding-bottom: 8px !important;
  }

  .dialog-title-text {
    font-size: 16px !important;
  }

  .dialog-message-content {
    font-size: 13.5px !important;
    line-height: 1.55 !important;
    max-height: 55vh !important;
    overflow-y: auto !important;
    word-break: break-word !important;
  }

  .dialog-actions-bar {
    margin-top: 14px !important;
  }

  .dialog-actions-bar button {
    height: 40px !important;
    font-size: 13.5px !important;
  }

  .modal-grid-2,
  .modal-grid-3,
  .modal-form-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .modal-grid-chips-4 {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }

  .template-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 600px) {
  .metric-stats-strip {
    grid-template-columns: 1fr 1fr !important;
  }
}
