/* ===== CSS Variables ===== */
:root {
  --primary: #7B2FBE;
  --primary-dark: #6a24a8;
  --primary-light: #A855F7;
  --primary-bg: rgba(123,47,190,0.15);
  --bg: #0A0A0A;
  --surface: #1A1A1A;
  --text: #F5F0FF;
  --text-secondary: #C4B5D4;
  --text-muted: #6B6B6B;
  --border: rgba(255,255,255,0.08);
  --danger: #ef4444;
  --danger-bg: rgba(239,68,68,0.12);
  --success: #34D399;
  --success-bg: rgba(52,211,153,0.12);
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
  --nav-height: 72px;
  --header-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { color: var(--text); }
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: #f87171 !important; }
.text-secondary { color: var(--text-secondary) !important; }

/* ===== Auth Screen ===== */
#auth-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0A0A0A url('../assets/auth-bg.svg') center/cover no-repeat;
  position: relative;
  overflow: hidden;
}

#auth-screen:not(.active) {
  display: none;
}

.auth-page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 40px 24px;
  animation: authFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.auth-container {
  width: 100%;
  text-align: center;
}

.auth-logo {
  margin: 0 auto 20px;
  filter: drop-shadow(0 0 30px rgba(123,47,190,0.4));
}

.auth-logo img {
  width: 64px;
  height: 64px;
}

.auth-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 700;
  margin: 0;
  color: #F5F0FF;
  letter-spacing: -0.02em;
}

.auth-tagline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #A855F7, #EC4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 6px 0 0;
}

.auth-subtitle {
  font-family: 'Inter', sans-serif;
  color: #6B6B6B;
  margin: 8px 0 32px;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.01em;
}

.auth-tabs {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  padding: 3px;
  gap: 3px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #6B6B6B;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.auth-tab:hover:not(.active) {
  color: #C4B5D4;
}

.auth-tab.active {
  background: rgba(123,47,190,0.2);
  color: #F5F0FF;
}

.auth-section .form-control {
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: #F5F0FF;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-section .form-control::placeholder {
  color: #6B6B6B;
}

.auth-section .form-control:focus {
  border-color: #7B2FBE;
  background: rgba(123,47,190,0.08);
  box-shadow: 0 0 0 3px rgba(123,47,190,0.15);
  color: #F5F0FF;
}

.auth-section .btn-primary {
  background: linear-gradient(135deg, #7B2FBE 0%, #EC4899 100%);
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #fff;
  box-shadow: 0 4px 20px rgba(123,47,190,0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.auth-section .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(123,47,190,0.45);
}

.auth-section .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(123,47,190,0.3);
}

.auth-section .btn-outline-primary {
  border: 1.5px solid rgba(123,47,190,0.4);
  color: #C4B5D4;
  background: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
}

.auth-section .btn-outline-primary:hover {
  border-color: #7B2FBE;
  color: #F5F0FF;
  background: rgba(123,47,190,0.1);
}

.auth-section a {
  color: #A855F7;
  text-decoration: none;
  font-weight: 500;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #6B6B6B;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

.auth-toggle-pw {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: #6B6B6B !important;
  font-weight: 300 !important;
  transition: color 0.15s;
}

.auth-toggle-pw:hover {
  color: #C4B5D4 !important;
}

.auth-section .alert-danger {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: #f87171;
  border-radius: 10px;
}

/* ===== App Layout ===== */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  backdrop-filter: blur(12px);
  background: rgba(10,10,10,0.85);
}

.app-header-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 20px;
  transition: all 0.15s;
}

.btn-icon:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

/* Content */
.app-content {
  flex: 1;
  padding: 16px 16px calc(var(--nav-height) + var(--safe-bottom) + 16px);
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: viewIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ===== Bottom Navigation ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 200;
  animation: navSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

@keyframes navSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.nav-item i {
  font-size: 20px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active i {
  transform: scale(1.15);
}

.nav-item:active:not(.nav-add) {
  transform: scale(0.9);
}

.nav-add-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-item.nav-add {
  position: relative;
}

.add-menu {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: 100;
  min-width: 140px;
  animation: fadeIn 0.15s ease;
}

.add-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}

.add-menu-item:hover {
  background: var(--primary-bg);
}

.add-menu-item:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.add-menu-item i {
  font-size: 16px;
  color: var(--primary);
}

.nav-item.nav-add i {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(123, 47, 190, 0.4);
  margin-top: -20px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s;
}

.nav-item.nav-add:hover i {
  transform: scale(1.1) !important;
  box-shadow: 0 6px 20px rgba(123, 47, 190, 0.5);
}

.nav-item.nav-add.menu-open i {
  transform: rotate(45deg) !important;
}

.nav-item.nav-add:active i {
  transform: scale(0.88) !important;
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: cardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }

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

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.stat-quip {
  font-size: 11px;
  font-weight: 500;
  margin-top: 6px;
  background: linear-gradient(135deg, #A855F7, #EC4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Section Headers ===== */
/* ===== Yearly Target ===== */
.target-stat-card {
  display: flex;
  flex-direction: column;
}

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

.target-edit {
  margin-top: 8px;
}

.target-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.target-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.target-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

/* ===== Recent Meets Table ===== */
.recent-meets-table {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.meets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.meets-table thead th {
  text-align: left;
  padding: 10px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.meets-table tbody td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

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

.meets-table-row {
  cursor: pointer;
  transition: background 0.15s;
}

.meets-table-row:hover {
  background: var(--primary-bg);
}

.meets-table-row:active {
  background: var(--border);
}

@media (max-width: 768px) {
  .hide-tablet {
    display: none;
  }
}

@media (max-width: 480px) {
  .hide-mobile {
    display: none;
  }
}

.meets-table-full {
  font-size: 13px;
  table-layout: fixed;
}

.meets-table-full thead th:nth-child(1) { width: 90px; }   /* Date */
.meets-table-full thead th:nth-child(2) { width: 15%; }    /* Person */
.meets-table-full thead th:nth-child(3) { width: 50px; text-align: center; }  /* Guys */
.meets-table-full thead th:nth-child(4) { width: 12%; }    /* City */
.meets-table-full thead th:nth-child(5) { width: 10%; }    /* Type */
.meets-table-full thead th:nth-child(6) { width: 10%; }    /* Location */
.meets-table-full thead th:nth-child(7) { width: 10%; }    /* Source */
/* Description takes remaining space */

.meets-table-full tbody td:nth-child(3) { text-align: center; }  /* Guys */

.meets-table-full tbody td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meets-table-desc {
  color: var(--text-secondary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Meets List ===== */
.meets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meet-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  animation: cardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.meets-list .meet-card:nth-child(1) { animation-delay: 0.03s; }
.meets-list .meet-card:nth-child(2) { animation-delay: 0.06s; }
.meets-list .meet-card:nth-child(3) { animation-delay: 0.09s; }
.meets-list .meet-card:nth-child(4) { animation-delay: 0.12s; }
.meets-list .meet-card:nth-child(5) { animation-delay: 0.15s; }
.meets-list .meet-card:nth-child(6) { animation-delay: 0.18s; }
.meets-list .meet-card:nth-child(7) { animation-delay: 0.21s; }
.meets-list .meet-card:nth-child(8) { animation-delay: 0.24s; }
.meets-list .meet-card:nth-child(9) { animation-delay: 0.27s; }
.meets-list .meet-card:nth-child(10) { animation-delay: 0.3s; }

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

.meet-card:active {
  transform: scale(0.97);
}

.meet-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.meet-card-person {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.meet-card-date {
  font-size: 12px;
  color: var(--text-muted);
}

.meet-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.meet-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--bg);
  border-radius: 100px;
  font-size: 12px;
  color: var(--text-secondary);
  transition: background 0.15s, transform 0.15s;
}

.meet-tag:hover {
  background: var(--border);
  transform: translateY(-1px);
}

.meet-tag i {
  font-size: 11px;
}

.meet-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meet-card-media {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.meet-card-media img,
.meet-card-media video {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s;
}

.meet-card-media img:hover,
.meet-card-media video:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  animation: emptyIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes emptyIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
  animation: emptyBounce 2s ease-in-out infinite;
}

@keyframes emptyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.empty-state p {
  margin: 0;
  font-size: 15px;
}

/* ===== Form Styles ===== */
.form-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control,
.form-select {
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(255,255,255,0.12);
  background: var(--surface) !important;
  color: var(--text);
  padding: 10px 14px;
  font-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-light);
  background: rgba(123,47,190,0.08);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(123, 47, 190, 0.15);
}

textarea.form-control {
  resize: vertical;
}

.input-group-text {
  background: rgba(255,255,255,0.05);
  border-color: var(--border);
  color: var(--text-muted);
}

/* Media Previews */
.media-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.media-preview {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  animation: tagPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.15s;
}

.media-preview:hover {
  transform: scale(1.05);
}

.media-preview img,
.media-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-preview .remove-media {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.form-actions {
  padding: 16px 0 32px;
}

/* ===== Buttons ===== */
.btn-primary {
  background: linear-gradient(135deg, #7B2FBE, #EC4899);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: #fff;
  padding: 12px 24px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #6a24a8, #db2777);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(123, 47, 190, 0.4);
}

.btn-primary:active {
  transform: translateY(0) scale(0.97);
  box-shadow: none;
}

.btn-outline-primary {
  color: var(--primary-light);
  border-color: rgba(123,47,190,0.4);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

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

.btn-outline-secondary {
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-outline-secondary:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-color: rgba(255,255,255,0.15);
}

.btn-outline-danger {
  border-radius: var(--radius-sm);
  color: var(--danger);
  border-color: rgba(239,68,68,0.3);
}

.btn-outline-danger:hover {
  background: rgba(239,68,68,0.12);
  color: #f87171;
  border-color: rgba(239,68,68,0.5);
}

.btn-link {
  color: var(--text);
  text-decoration: none;
}

.btn-link:hover {
  color: var(--primary-light);
}

/* ===== Select2 Overrides ===== */
.select2-container--bootstrap-5 .select2-selection {
  border: 1.5px solid rgba(255,255,255,0.12) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--surface) !important;
  min-height: 44px !important;
  padding: 6px 12px !important;
  font-size: 16px !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  line-height: 30px !important;
  color: var(--text) !important;
  padding-left: 0 !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
  height: 42px !important;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
  border-color: var(--primary-light) !important;
  background: rgba(123,47,190,0.08) !important;
  box-shadow: 0 0 0 3px rgba(123, 47, 190, 0.15) !important;
}

.select2-dropdown {
  border: 1.5px solid rgba(255,255,255,0.12) !important;
  border-radius: var(--radius-sm) !important;
  background: #1A1A1A !important;
  box-shadow: var(--shadow-lg) !important;
  overflow: hidden;
}

.select2-results__option {
  padding: 10px 14px !important;
  font-size: 15px !important;
  color: var(--text) !important;
}

.select2-results__option--highlighted {
  background: var(--primary) !important;
  color: #fff !important;
}

.select2-search--dropdown .select2-search__field {
  border-radius: var(--radius-sm) !important;
  padding: 8px 12px !important;
  font-size: 15px !important;
  background: rgba(255,255,255,0.05) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

/* Hide the clear (x) button on Select2 */
.select2-selection__clear {
  display: none !important;
}

/* ===== Flatpickr Overrides ===== */
.flatpickr-calendar {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1.5px solid var(--border) !important;
  font-family: inherit !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}

.flatpickr-day:hover {
  background: var(--primary-bg) !important;
  border-color: var(--primary-bg) !important;
}

.flatpickr-day.today {
  border-color: var(--primary-light) !important;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
  fill: var(--primary) !important;
}

.flatpickr-input.flatpickr-mobile {
  font-size: 16px !important;
}

input.flatpickr-input[readonly] {
  background: var(--surface);
  cursor: pointer;
}

/* ===== Reports ===== */
.report-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  animation: cardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.report-section:nth-of-type(1) { animation-delay: 0.05s; }
.report-section:nth-of-type(2) { animation-delay: 0.1s; }
.report-section:nth-of-type(3) { animation-delay: 0.15s; }
.report-section:nth-of-type(4) { animation-delay: 0.2s; }
.report-section:nth-of-type(5) { animation-delay: 0.25s; }
.report-section:nth-of-type(6) { animation-delay: 0.3s; }

.report-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
}

.report-section canvas {
  max-height: 250px;
}

/* Summary Table */
.summary-table {
  font-size: 14px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row .label {
  color: var(--text-secondary);
}

.summary-row .value {
  font-weight: 600;
  color: var(--text);
}

/* ===== Session Banner ===== */
.session-banner {
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.session-banner:hover {
  background: var(--primary-dark);
}

.session-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-banner-timer {
  font-variant-numeric: tabular-nums;
}

.session-banner-count {
  font-weight: 400;
}

/* ===== Session ===== */
.session-header {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.session-timer {
  font-size: 36px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: 0.02em;
}

.session-count {
  margin-top: 4px;
  font-size: 18px;
  color: var(--primary);
  font-weight: 600;
}

.session-code-display {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.session-code-display strong {
  color: var(--primary);
  font-size: 18px;
  letter-spacing: 0.15em;
}

.session-qr {
  margin-top: 12px;
}

.session-qr canvas {
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.session-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  width: 100%;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.session-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.session-toggle:hover {
  background: rgba(255,255,255,0.08);
}

.session-toggle input {
  display: none;
}

.session-toggle-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.session-toggle-info i {
  font-size: 15px;
  color: var(--primary-light);
}

.session-toggle-track {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: rgba(255,255,255,0.1);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.session-toggle-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #6B6B6B;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s, background 0.2s;
}

.session-toggle input:checked ~ .session-toggle-track {
  background: rgba(123,47,190,0.3);
}

.session-toggle input:checked ~ .session-toggle-track .session-toggle-thumb {
  transform: translateX(18px);
  background: #A855F7;
}

.session-count-label {
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 4px;
}

/* Live session ratings */
.session-live-rating {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.session-live-rating-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.session-live-rating-avg {
  font-size: 22px;
  font-weight: 700;
  color: #f59e0b;
}

.session-live-rating-count {
  font-size: 12px;
  color: var(--text-muted);
}

.session-live-rating-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
}

.session-live-rating-comment {
  color: var(--text-secondary);
  font-style: italic;
}

.session-entry-user {
  font-size: 12px;
  color: var(--primary-light);
  font-weight: 500;
  margin-left: 4px;
}

.session-entry-rating {
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.session-entry-rating-comment {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.session-entries {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.session-entry {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  animation: fadeIn 0.3s ease;
}

.session-entry-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-entry-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.session-entry-time {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.session-entry-media {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.session-entry-media img,
.session-entry-media video {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
}

.session-media-wrap {
  position: relative;
  display: inline-block;
}

.session-media-del {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--danger);
  border: none;
  color: #fff;
  font-size: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.session-media-wrap:hover .session-media-del {
  display: flex;
}

.session-entry-actions {
  display: flex;
  gap: 6px;
  align-self: flex-start;
}

.session-entry-actions .btn {
  padding: 4px 8px;
  font-size: 14px;
}

.session-add-btn {
  width: 60px;
  height: 60px;
  border-radius: 50% !important;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.session-actions {
  text-align: center;
}

/* Session timeline header */
.session-tl-header {
  text-align: center;
  padding: 20px 16px 16px;
}

.session-tl-header-count {
  font-size: 42px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.session-tl-header-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.session-tl-code {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--primary);
  margin-top: 8px;
}

.session-tl-qr {
  margin-top: 10px;
}

.session-tl-qr canvas {
  border-radius: 8px;
}

/* Session timeline in meet view */
.session-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 20px;
  margin-bottom: 20px;
}

.session-timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.session-tl-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  margin-left: 12px;
}

.session-tl-entry::before {
  content: '';
  position: absolute;
  left: -19px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--primary);
}

.session-tl-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.session-tl-content {
  flex: 1;
  min-width: 0;
}

.session-tl-time {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.session-tl-media {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.session-tl-media img,
.session-tl-media video {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
}

.session-tl-video-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.session-tl-video-wrap video {
  pointer-events: none;
}

.session-tl-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
}

.session-tl-play i {
  color: #fff;
  font-size: 20px;
}

.session-tl-gap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  margin-left: 12px;
}

.session-tl-gap span {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.session-tl-delete {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
  transition: background 0.15s, color 0.15s;
}

.session-tl-delete:hover {
  background: var(--danger);
  color: #fff;
}

/* Show delete buttons when form is in edit mode */
.view-panel--editing .session-tl-delete {
  display: flex;
}

/* Session ratings */
.session-ratings-section {
  margin-top: 20px;
  margin-left: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.session-ratings-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.session-ratings-avg {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.session-ratings-stars {
  display: flex;
  gap: 2px;
  font-size: 16px;
}

.session-ratings-count {
  font-size: 13px;
  color: var(--text-muted);
}

.session-rating-item {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}

.session-rating-stars {
  display: flex;
  gap: 2px;
  font-size: 14px;
  margin-bottom: 4px;
}

.session-rating-comment {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.5;
}

.session-rating-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== Media Gallery ===== */
.media-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

@media (min-width: 640px) {
  .media-gallery {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  cursor: pointer;
  background: var(--border);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.05);
}

.gallery-link {
  cursor: pointer;
}

.gallery-sentinel {
  grid-column: 1 / -1;
  height: 1px;
}

.gallery-link:hover {
  text-decoration: underline;
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 6px;
  font-size: 10px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  pointer-events: none;
}

/* ===== Last Met Report ===== */
.last-met-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.last-met-row:last-child {
  border-bottom: none;
}

.last-met-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.last-met-name {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.last-met-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.ago-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 12px;
}

.ago-recent {
  background: rgba(34, 197, 94, 0.15);
  color: #34d399;
}

.ago-moderate {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.ago-old {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.ago-stale {
  background: rgba(196, 181, 212, 0.1);
  color: #C4B5D4;
}

/* ===== Settings ===== */
.settings-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  animation: cardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.settings-section:nth-child(1) { animation-delay: 0.05s; }
.settings-section:nth-child(2) { animation-delay: 0.1s; }
.settings-section:nth-child(3) { animation-delay: 0.15s; }
.settings-section:nth-child(4) { animation-delay: 0.2s; }
.settings-section:nth-child(5) { animation-delay: 0.25s; }
.settings-section:nth-child(6) { animation-delay: 0.3s; }

.settings-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--primary-bg);
  color: var(--text);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  animation: tagPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.15s, background 0.15s;
}

.tag-item:hover {
  transform: scale(1.05);
  background: rgba(123,47,190,0.25);
}

@keyframes tagPop {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.tag-item .tag-remove {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}

.tag-item .tag-remove:hover {
  background: rgba(123, 47, 190, 0.3);
}

/* ===== Search Bar ===== */
.search-bar .input-group-text {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text-muted);
}

.search-bar .form-control {
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.search-bar .form-control:focus {
  box-shadow: none;
}

.search-bar .input-group:focus-within .input-group-text {
  border-color: var(--primary-light);
}

.search-bar .input-group:focus-within .form-control {
  border-color: var(--primary-light);
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

.app-toast {
  background: rgba(123,47,190,0.9);
  color: #F5F0FF;
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1), toastOut 0.35s ease 2.2s forwards;
  white-space: nowrap;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(0.95); }
}

/* ===== Media viewer overlay ===== */
.media-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: overlayIn 0.25s ease;
}

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

.media-overlay img,
.media-overlay video {
  max-width: 100%;
  max-height: 90dvh;
  border-radius: var(--radius);
  animation: overlayZoom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes overlayZoom {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.media-overlay-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: white;
  border: none;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.media-overlay-close:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.1);
}

/* ===== Responsive ===== */
@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(12, 1fr);
  }

  .stats-grid .stat-card {
    grid-column: span 3;
  }

  .stat-card-third {
    grid-column: span 4 !important;
  }

  .stat-card-quarter {
    grid-column: span 3 !important;
  }

  .app-content {
    padding: 24px 24px calc(var(--nav-height) + var(--safe-bottom) + 24px);
  }
}

/* ===== Utilities ===== */
.view {
  display: none;
}

.view.active {
  display: flex;
}
