/* === UNIFIED FORM INPUTS (Dark Theme) === */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #1a1d21;
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #1a1d21;
  border-color: #ffc107;
  box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.2);
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .form-select option {
  background-color: #1a1d21;
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .form-control::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

[data-bs-theme="dark"] .input-group-text {
  background-color: #15181c;
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

/* === NAVBAR LOGO === */
.navbar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  border-radius: 8px;
  position: relative;
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.navbar-logo-icon {
  font-size: 1.4rem;
  font-weight: 400;
  color: #000;
  line-height: 1;
}

.navbar-logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
}

.navbar-logo-accent {
  color: #ffc107;
  font-weight: 400;
}

/* === ADMIN NAV LINK === */
.nav-link-admin {
  color: #dc3545 !important;
  font-weight: 500;
}
.nav-link-admin:hover,
.nav-link-admin:focus {
  color: #ff6b7a !important;
}
.nav-link-admin.active {
  color: #ff6b7a !important;
}

/* === STICKY FOOTER === */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* === SCOREBOARD === */
.scoreboard {
  background: #1a1a2e;
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  user-select: none;
  overflow: hidden;
}

.sb-category {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: #aaa;
  padding: 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.sb-main {
  display: flex;
  flex: 1;
  align-items: stretch;
}

.sb-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
}

.sb-side-white {
  background: #e8e8e8;
  color: #111;
}

.sb-side-blue {
  background: #1a3a8a;
  color: #fff;
}

.sb-name {
  font-size: 2.2rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  text-align: center;
  letter-spacing: 1px;
}

.sb-score {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin: 0.5rem 0;
}

.sb-score-item {
  text-align: center;
}

.sb-score-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  opacity: 0.7;
  letter-spacing: 1px;
}

.sb-score-value {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
}

.sb-ippon {
  font-size: 5rem;
  color: #ffd700;
  font-weight: 900;
}

.sb-shido {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.sb-shido-card {
  width: 24px;
  height: 36px;
  border-radius: 3px;
  background: #444;
  border: 2px solid #666;
}

.sb-shido-card.active {
  background: #ffc107;
  border-color: #e0a800;
}

.sb-shido-card.hansoku {
  background: #dc3545;
  border-color: #c82333;
}

.sb-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-width: 200px;
  background: #0f0f23;
}

.sb-timer {
  font-size: 5rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}

.sb-timer.running {
  color: #00ff88;
}

.sb-timer.stopped {
  color: #ff4444;
}

.sb-osaekomi {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffc107;
  margin-top: 0.5rem;
  font-variant-numeric: tabular-nums;
  visibility: hidden;
}

.sb-osaekomi.active {
  visibility: visible;
  animation: pulse 1s infinite;
}

.sb-golden-score {
  background: #ffd700;
  color: #000;
  padding: 0.2rem 1rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 1rem;
  margin-top: 0.5rem;
  display: none;
  text-transform: uppercase;
}

.sb-golden-score.active {
  display: block;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Scoreboard mobile scaling */
@media (max-width: 1200px) {
  .scoreboard {
    zoom: 0.85;
    min-height: calc(100vh / 0.85);
  }
}

@media (max-width: 1024px) {
  .scoreboard {
    zoom: 0.7;
    min-height: calc(100vh / 0.7);
  }
}

@media (max-width: 768px) {
  .scoreboard {
    zoom: 0.55;
    min-height: calc(100vh / 0.55);
  }
}

@media (max-width: 480px) {
  .scoreboard {
    zoom: 0.35;
    min-height: calc(100vh / 0.35);
  }
}

/* === OPERATOR PANEL === */
.op-panel {
  min-height: 100vh;
}

.op-side {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.op-side-white {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.op-side-blue {
  background: rgba(26, 58, 138, 0.3);
  border: 2px solid #3366cc;
}

.op-btn {
  min-width: 60px;
  min-height: 50px;
  font-size: 1.1rem;
  font-weight: 600;
}

.op-timer-display {
  font-size: 3rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* === TOURNAMENT BANNER === */
.tournament-banner {
  position: relative;
  height: 200px;
  background-size: cover;
  background-position: center;
  border-radius: 0;
}

.tournament-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 100%);
  display: flex;
  align-items: flex-end;
  padding: 1.5rem 0;
}

/* === BRACKET === */
.bracket-container {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding: 2rem 1rem;
  position: relative;
}

.bracket-connector-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.bracket-round {
  min-width: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.bracket-round-title {
  text-align: center;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: #888;
}

.bracket-match {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  margin: 0.5rem 0;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bracket-match:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.bracket-match .fighter {
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.3s ease, background 0.3s ease;
}

.bracket-match .fighter-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.bracket-match .fighter-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bracket-match .fighter-score {
  margin-left: auto;
  flex-shrink: 0;
}

.bracket-match .fighter.white {
  background: rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bracket-match .fighter.blue {
  background: rgba(26, 58, 138, 0.2);
}

.bracket-match .fighter.winner {
  font-weight: 700;
  background: rgba(25, 135, 84, 0.15);
  border-left: 3px solid #198754;
}

.bracket-match .fighter.loser {
  opacity: 0.45;
}

.bracket-match .win-method {
  text-align: center;
  font-size: 0.7rem;
  color: #888;
  padding: 0.15rem;
  background: rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.bracket-bronze {
  max-width: 260px;
}

@keyframes winPulse {
  0% { background-color: rgba(25, 135, 84, 0.4); }
  100% { background-color: rgba(25, 135, 84, 0.15); }
}

.bracket-match .fighter.winner {
  animation: winPulse 0.6s ease-out;
}

/* === REPECHAGE === */
.repechage-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
}

.repechage-title {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #888;
  margin-bottom: 1rem;
}

.repechage-grid {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.repechage-block {
  min-width: 260px;
}

/* === POOL TABLE === */
.pool-cross-table .table {
  font-size: 0.85rem;
}

.pool-cell {
  width: 40px;
  min-width: 40px;
  vertical-align: middle;
}

.pool-cell-self {
  background: rgba(255, 255, 255, 0.03);
}

.pool-win {
  color: #198754;
  font-weight: 700;
}

.pool-loss {
  color: #dc3545;
  font-weight: 700;
}

.pool-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.75rem;
}

.pool-gold {
  background: #ffd700;
  color: #000;
}

.pool-silver {
  background: #c0c0c0;
  color: #000;
}

.pool-bronze {
  background: #cd7f32;
  color: #000;
}

/* === DRAW SHEET (Column View) === */
.draw-sheet {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  padding: 1rem;
  overflow-x: auto;
  min-width: min-content;
}

.draw-half {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.draw-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 260px;
  gap: 1rem;
}

.draw-half-title {
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #ffc107;
  padding: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.3rem;
}

.draw-match {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.draw-match:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.draw-match-final {
  border-color: rgba(255, 215, 0, 0.3);
}

.draw-label {
  background: rgba(255, 193, 7, 0.12);
  color: #ffc107;
  font-weight: 900;
  font-size: 0.75rem;
  padding: 0.7rem 0.5rem;
  min-width: 42px;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}

.draw-fighters {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.draw-fighter {
  padding: 0.3rem 0.5rem;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.draw-fighter.white {
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.draw-fighter.blue {
  background: rgba(26, 58, 138, 0.15);
}

.draw-fighter.winner {
  font-weight: 700;
  border-left: 3px solid #198754;
  background: rgba(25, 135, 84, 0.1);
}

.draw-fighter.loser {
  opacity: 0.4;
}

.draw-fighter-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.draw-fighter-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.draw-fighter-score {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
}

.draw-fighter-flag {
  width: 18px;
  height: 13px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.draw-fighter-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.draw-fighter-info .draw-fighter-name {
  flex: none;
  line-height: 1.1;
}

.draw-fighter-club {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}

.draw-fighter.winner .draw-fighter-club {
  color: rgba(25, 135, 84, 0.7);
}

.draw-result {
  font-size: 0.65rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 0.5rem;
  min-width: 55px;
  text-align: center;
  align-self: center;
}

.draw-final-box {
  width: 100%;
}

.draw-special {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

/* === UNIFIED CREATE FORM CARD === */
.create-form-card {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.3s ease;
}

.create-form-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.create-form-card .card-header {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.08) 0%, transparent 100%);
}

/* === CATEGORY CARD (Tournament Detail) === */
.category-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.category-card .card-header {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.06) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* === IMPROVED BRACKET MATCH === */
.bracket-match {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
  margin: 0.6rem 0;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.bracket-match:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 193, 7, 0.3);
}

.bracket-match .fighter {
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.bracket-match .fighter-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.bracket-match:hover .fighter-avatar {
  border-color: rgba(255, 193, 7, 0.4);
}

.bracket-match .fighter.winner .fighter-avatar {
  border-color: #198754;
  box-shadow: 0 0 8px rgba(25, 135, 84, 0.4);
}

.bracket-match .fighter-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.bracket-match .fighter-score {
  margin-left: auto;
  flex-shrink: 0;
  font-weight: 700;
}

.bracket-match .fighter-flag {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bracket-match .fighter-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.bracket-match .fighter-info .fighter-name {
  flex: none;
  line-height: 1.2;
}

.bracket-match .fighter-club {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.bracket-match .fighter-club i {
  font-size: 0.6rem;
  margin-right: 0.2rem;
  opacity: 0.7;
}

.bracket-match .fighter.winner .fighter-club {
  color: rgba(25, 135, 84, 0.8);
}

.bracket-match .winner-icon {
  font-size: 1rem;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  animation: winner-pulse 2s ease-in-out infinite;
}

.bracket-match .winner-icon.gold {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.bracket-match .winner-icon.silver {
  color: #c0c0c0;
  text-shadow: 0 0 6px rgba(192, 192, 192, 0.4);
}

.bracket-match .winner-icon.bronze {
  color: #cd7f32;
  text-shadow: 0 0 6px rgba(205, 127, 50, 0.4);
}

@keyframes winner-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.bracket-match .fighter.white {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bracket-match .fighter.blue {
  background: linear-gradient(90deg, rgba(26, 58, 138, 0.25) 0%, rgba(26, 58, 138, 0.15) 100%);
}

.bracket-match .fighter.winner {
  font-weight: 700;
  background: linear-gradient(90deg, rgba(25, 135, 84, 0.2) 0%, rgba(25, 135, 84, 0.1) 100%);
  border-left: 4px solid #198754;
}

.bracket-match .fighter.loser {
  opacity: 0.4;
}

.bracket-match .win-method {
  text-align: center;
  font-size: 0.7rem;
  color: #ffc107;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 193, 7, 0.1);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* === IMPROVED BRACKET ROUND === */
.bracket-round {
  min-width: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 0 1rem;
  position: relative;
  z-index: 1;
}

.bracket-round-title {
  text-align: center;
  font-weight: 800;
  margin-bottom: 1rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 3px;
  color: #ffc107;
  padding: 0.5rem 1rem;
  background: rgba(255, 193, 7, 0.08);
  border-radius: 6px;
  border: 1px solid rgba(255, 193, 7, 0.15);
}

/* === IMPROVED REPECHAGE === */
.repechage-section {
  border-top: 2px solid rgba(255, 193, 7, 0.2);
  padding-top: 1.5rem;
  margin-top: 1rem;
}

.repechage-title {
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #cd7f32;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.repechage-title::before {
  content: "";
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, #cd7f32, transparent);
}

.repechage-grid {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.repechage-block {
  min-width: 280px;
  flex: 1;
}

/* === IMPROVED POOL TABLE === */
.pool-cross-table {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.pool-cross-table .table {
  font-size: 0.85rem;
  margin-bottom: 0;
}

.pool-cross-table .table th {
  background: rgba(255, 193, 7, 0.08);
  color: #ffc107;
  font-weight: 700;
}

.pool-cell {
  width: 48px;
  min-width: 48px;
  vertical-align: middle;
  text-align: center;
  transition: background 0.2s ease;
}

.pool-cell:hover {
  background: rgba(255, 255, 255, 0.05);
}

.pool-cell-self {
  background: rgba(255, 255, 255, 0.02) !important;
}

.pool-win {
  color: #198754;
  font-weight: 800;
  font-size: 1rem;
}

.pool-loss {
  color: #dc3545;
  font-weight: 800;
  font-size: 1rem;
}

.pool-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.8rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pool-gold {
  background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
  color: #000;
}

.pool-silver {
  background: linear-gradient(135deg, #e0e0e0 0%, #a0a0a0 100%);
  color: #000;
}

.pool-bronze {
  background: linear-gradient(135deg, #cd7f32 0%, #8b5a2b 100%);
  color: #fff;
}

/* === MATCH LIST / PROTOCOL === */
.match-list-section {
  margin-top: 0.5rem;
}

.match-list-round-title {
  color: #ffc107;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0.5rem 0;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid rgba(255, 193, 7, 0.15);
}

.match-list-round-title:first-child {
  margin-top: 0;
}

.match-list-table {
  font-size: 0.85rem;
}

.match-list-table tbody tr {
  transition: background 0.2s ease;
}

.match-list-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

.match-list-table tbody tr.table-warning {
  background: rgba(255, 193, 7, 0.1) !important;
}

.match-list-table tbody tr.match-list-finished {
  opacity: 0.85;
}

.match-list-table tbody tr.match-list-finished:hover {
  opacity: 1;
}

.match-list-rr {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
}

/* === ATHLETES TABLE === */
.athletes-table tbody tr {
  transition: background 0.2s ease, transform 0.2s ease;
}

.athletes-table tbody tr:hover {
  background: rgba(255, 193, 7, 0.05) !important;
}

/* === TOURNAMENT CARD IMPROVEMENTS === */
.tournament-card .card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.tournament-card .card:hover {
  border-color: rgba(255, 193, 7, 0.3);
}

.tournament-card .card-img-top {
  transition: transform 0.3s ease;
}

.tournament-card .card:hover .card-img-top {
  transform: scale(1.05);
}

.tournament-card .card-body {
  position: relative;
  z-index: 1;
  background: var(--bs-body-bg);
}

/* === TOURNAMENT SETTINGS PANEL === */
.settings-panel {
  background: linear-gradient(135deg, rgba(33, 37, 41, 0.95) 0%, rgba(33, 37, 41, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.settings-panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-panel-header i {
  color: #ffc107;
  font-size: 1.1rem;
}

.settings-panel-header span {
  font-weight: 600;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}

.settings-panel .form-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

.settings-panel .form-control,
.settings-panel .form-select {
  font-size: 0.875rem;
}

.settings-panel .form-text {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.7rem;
}

.settings-panel .input-group-text {
  font-size: 0.75rem;
}

/* === BRACKET GENERATION FORM === */
.bracket-gen-form {
  background: linear-gradient(135deg, rgba(33, 37, 41, 0.95) 0%, rgba(33, 37, 41, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.bracket-gen-form .form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bracket-gen-form .form-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bracket-gen-form .form-header-title i {
  color: #ffc107;
  font-size: 1.1rem;
}

.bracket-gen-form .form-header-title span {
  font-weight: 600;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}

.bracket-gen-form .form-header-count {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Search bar */
.bracket-gen-form .search-bar,
.bulk-reg-form .search-bar {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
}

.bracket-gen-form .search-bar .input-group-text,
.bulk-reg-form .search-bar .input-group-text {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
}

.bracket-gen-form .search-bar .form-control,
.bulk-reg-form .search-bar .form-control {
  background: transparent;
  border: none;
  color: #e9ecef;
}

.bracket-gen-form .search-bar .form-control:focus,
.bulk-reg-form .search-bar .form-control:focus {
  box-shadow: none;
}

.bracket-gen-form .search-bar .form-control::placeholder,
.bulk-reg-form .search-bar .form-control::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Action buttons row */
.bracket-gen-form .action-buttons,
.bulk-reg-form .action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.bracket-gen-form .action-buttons .btn,
.bulk-reg-form .action-buttons .btn {
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.bracket-gen-form .action-buttons .btn-outline-secondary,
.bulk-reg-form .action-buttons .btn-outline-secondary {
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
}

.bracket-gen-form .action-buttons .btn-outline-secondary:hover,
.bulk-reg-form .action-buttons .btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.bracket-gen-form .action-buttons .btn-outline-info,
.bulk-reg-form .action-buttons .btn-outline-info {
  border-color: rgba(13, 202, 240, 0.3);
  color: #0dcaf0;
}

.bracket-gen-form .action-buttons .btn-outline-info:hover,
.bulk-reg-form .action-buttons .btn-outline-info:hover {
  background: rgba(13, 202, 240, 0.15);
  border-color: rgba(13, 202, 240, 0.5);
}

/* Selected count badge */
.bracket-gen-form .selected-count,
.bulk-reg-form .selected-count {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
}

/* === SEEDED ATHLETES SECTION === */
.seeded-section {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.08) 0%, rgba(255, 193, 7, 0.03) 100%);
  border: 1px solid rgba(255, 193, 7, 0.2) !important;
  border-radius: 10px !important;
  padding: 1rem !important;
  margin-bottom: 1rem !important;
}

.seeded-section .seeded-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.seeded-section .seeded-header i {
  color: #ffc107;
  font-size: 1rem;
}

.seeded-section .seeded-header .title {
  font-weight: 600;
  font-size: 0.85rem;
  color: #ffc107;
}

.seeded-section .seeded-header .hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-left: auto;
}

.seeded-section .form-label {
  color: rgba(255, 193, 7, 0.8);
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.seeded-section .seeded-select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 193, 7, 0.25);
  color: #e9ecef;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.seeded-section .seeded-select:focus {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 193, 7, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.15);
}

.seeded-section .seeded-select option {
  background: #2b3035;
  color: #e9ecef;
}

/* === BRACKET FORM FOOTER === */
.bracket-gen-form .form-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.bracket-gen-form .btn-warning {
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
  transition: all 0.2s ease;
}

.bracket-gen-form .btn-warning:hover {
  box-shadow: 0 4px 16px rgba(255, 193, 7, 0.4);
  transform: translateY(-1px);
}

/* === IMPROVED ATHLETE SELECTOR === */
.athlete-list-scroll {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 193, 7, 0.3) transparent;
}

.athlete-list-scroll::-webkit-scrollbar {
  width: 8px;
}

.athlete-list-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.athlete-list-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 193, 7, 0.3);
  border-radius: 4px;
}

.athlete-item {
  padding: 0.25rem;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.athlete-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.athlete-item .form-check-input:checked ~ .form-check-label {
  color: #ffc107;
}

/* === VIEW TOGGLE BUTTONS === */
.bracket-view-toggle {
  transition: all 0.2s ease;
}

.bracket-view-toggle.active {
  background: rgba(255, 193, 7, 0.15) !important;
  border-color: rgba(255, 193, 7, 0.4) !important;
  color: #ffc107 !important;
}

/* === STATUS BADGES === */
.badge.bg-success {
  background: linear-gradient(135deg, #198754 0%, #157347 100%) !important;
}

.badge.bg-secondary {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
}

/* === BRACKET CONTAINER SCROLLBAR === */
.bracket-container {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 193, 7, 0.3) transparent;
  padding-bottom: 1rem;
}

.bracket-container::-webkit-scrollbar {
  height: 8px;
}

.bracket-container::-webkit-scrollbar-track {
  background: transparent;
}

.bracket-container::-webkit-scrollbar-thumb {
  background: rgba(255, 193, 7, 0.3);
  border-radius: 4px;
}

/* === ACTIVE MATCH (LIVE) === */
.bracket-match.match-active {
  border-color: rgba(255, 193, 7, 0.5);
  box-shadow: 0 0 16px rgba(255, 193, 7, 0.2);
  animation: matchActivePulse 2s ease-in-out infinite;
}

@keyframes matchActivePulse {
  0%, 100% { box-shadow: 0 0 16px rgba(255, 193, 7, 0.2); }
  50% { box-shadow: 0 0 24px rgba(255, 193, 7, 0.4); }
}

.bracket-match .win-method.match-live {
  background: linear-gradient(90deg, rgba(220, 53, 69, 0.2) 0%, rgba(220, 53, 69, 0.1) 100%);
  color: #dc3545;
  font-weight: 700;
  animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* === FINISHED MATCH === */
.bracket-match.match-finished {
  opacity: 0.9;
}

.bracket-match.match-finished:hover {
  opacity: 1;
}

/* === WINNER SCORE BADGE === */
.bracket-match .fighter.winner .fighter-score.badge.bg-success {
  animation: winnerBadgePop 0.4s ease-out;
}

@keyframes winnerBadgePop {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* === EMPTY SLOT STYLING === */
.bracket-match .fighter-name.text-muted {
  font-style: italic;
  opacity: 0.5;
}

/* === BRACKET ROUND FINAL === */
.bracket-round:last-child .bracket-match {
  border-color: rgba(255, 215, 0, 0.3);
}

.bracket-round:last-child .bracket-round-title {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.3);
}

/* === BRACKET DRAG AND DROP === */
.draggable-fighter {
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.draggable-fighter:hover {
  background: rgba(255, 193, 7, 0.1) !important;
}

.draggable-fighter.dragging {
  opacity: 0.5;
  cursor: grabbing;
  transform: scale(0.95);
}

.draggable-fighter.drag-over {
  background: rgba(255, 193, 7, 0.25) !important;
  box-shadow: inset 0 0 0 2px rgba(255, 193, 7, 0.6);
}

.bracket-match.updating {
  opacity: 0.6;
  pointer-events: none;
}

.bracket-match.updating::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   ATHLETE PROFILE PAGE
   ============================================ */

/* Profile Hero */
.profile-hero {
  position: relative;
  padding: 2rem 0 5rem;
  overflow: hidden;
}

.profile-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, transparent 50%),
              linear-gradient(225deg, rgba(26, 58, 138, 0.15) 0%, transparent 50%);
  z-index: 0;
}

.profile-hero-bg::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 193, 7, 0.08) 0%, transparent 70%);
  animation: heroGlow 8s ease-in-out infinite;
}

@keyframes heroGlow {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

/* Profile Avatar */
.profile-avatar-container {
  position: relative;
  width: 160px;
  height: 160px;
}

.profile-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 193, 7, 0.4);
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.profile-avatar:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 193, 7, 0.6);
}

/* Flag container */
.profile-flag-container {
  position: absolute;
  bottom: 0;
  right: -5px;
  z-index: 3;
  background: #212529;
  padding: 3px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.profile-flag {
  display: block;
  width: 32px;
  height: auto;
  border-radius: 2px;
}

/* Profile Name */
.profile-name {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

.profile-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1rem;
}

/* Profile Badges */
.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-badge:hover {
  transform: translateY(-2px);
}

.profile-badge-category {
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.2) 0%, rgba(13, 110, 253, 0.1) 100%);
  color: #6ea8fe;
  border: 1px solid rgba(13, 110, 253, 0.3);
}

.profile-badge-weight {
  background: linear-gradient(135deg, rgba(108, 117, 125, 0.2) 0%, rgba(108, 117, 125, 0.1) 100%);
  color: #adb5bd;
  border: 1px solid rgba(108, 117, 125, 0.3);
}

.profile-badge-rank {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 193, 7, 0.1) 100%);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.profile-badge-year {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Profile Actions */
.profile-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Stat Cards */
.stat-card {
  background: linear-gradient(135deg, rgba(33, 37, 41, 0.95) 0%, rgba(33, 37, 41, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  backdrop-filter: blur(10px);
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.stat-card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

.stat-card-value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card-value small {
  font-size: 1.2rem;
  opacity: 0.7;
}

.stat-card-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.6;
}

.stat-card-wins {
  border-color: rgba(25, 135, 84, 0.3);
}

.stat-card-wins .stat-card-icon,
.stat-card-wins .stat-card-value {
  color: #198754;
}

.stat-card-wins::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #198754, transparent);
}

.stat-card-losses {
  border-color: rgba(220, 53, 69, 0.3);
}

.stat-card-losses .stat-card-icon,
.stat-card-losses .stat-card-value {
  color: #dc3545;
}

.stat-card-losses::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #dc3545, transparent);
}

.stat-card-matches {
  border-color: rgba(13, 110, 253, 0.3);
}

.stat-card-matches .stat-card-icon,
.stat-card-matches .stat-card-value {
  color: #0d6efd;
}

.stat-card-matches::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0d6efd, transparent);
}

.stat-card-rate {
  border-color: rgba(255, 193, 7, 0.3);
}

.stat-card-rate .stat-card-icon,
.stat-card-rate .stat-card-value {
  color: #ffc107;
}

.stat-card-rate::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ffc107, transparent);
}

/* Progress indicator on wins card */
.stat-card-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, #198754, #20c997);
  transition: width 1s ease-out;
}

/* Profile Edit Card */
.profile-edit-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(33, 37, 41, 0.95);
}

.profile-edit-card .card-header {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.08) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Match History Card */
.match-history-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(33, 37, 41, 0.95);
}

.match-history-card .card-header {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.08) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Match History Table */
.match-history-table {
  --bs-table-bg: transparent;
}

.match-history-table thead {
  background: rgba(0, 0, 0, 0.2);
}

.match-history-table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.6);
  border: none;
  padding: 1rem;
}

.match-history-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
}

.match-history-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.match-row {
  animation: matchRowFadeIn 0.4s ease-out both;
}

@keyframes matchRowFadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.match-row.match-won {
  border-left: 3px solid #198754;
}

.match-row.match-lost {
  border-left: 3px solid #dc3545;
}

/* Opponent Link */
.opponent-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

.opponent-link:hover {
  color: #ffc107;
}

.opponent-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.opponent-link:hover .opponent-avatar {
  border-color: rgba(255, 193, 7, 0.5);
  transform: scale(1.1);
}

/* Result Badges */
.result-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.result-win {
  background: linear-gradient(135deg, rgba(25, 135, 84, 0.2) 0%, rgba(25, 135, 84, 0.1) 100%);
  color: #20c997;
  border: 1px solid rgba(25, 135, 84, 0.3);
}

.result-loss {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.2) 0%, rgba(220, 53, 69, 0.1) 100%);
  color: #ea868f;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Win Method Badge */
.win-method-badge {
  font-size: 0.75rem;
  color: #ffc107;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Negative margin utility */
.mt-n4 {
  margin-top: -2rem !important;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .profile-name {
    font-size: 1.75rem;
  }

  .profile-avatar-container {
    width: 120px;
    height: 120px;
  }

  .profile-avatar {
    width: 110px;
    height: 110px;
  }

  .profile-flag {
    width: 32px;
    height: 32px;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-card-value {
    font-size: 1.75rem;
  }

  .profile-hero {
    padding: 1.5rem 0 4rem;
  }
}

/* ============================================
   NAVBAR PROFILE DROPDOWN
   ============================================ */

.nav-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  color: #fff;
  transition: all 0.2s ease;
}

.nav-profile-btn:hover,
.nav-profile-btn:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 193, 7, 0.3);
  color: #fff;
}

.nav-profile-btn::after {
  margin-left: 0.25rem;
  opacity: 0.6;
}

.nav-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 193, 7, 0.4);
  flex-shrink: 0;
  transition: border-color 0.2s ease;
}

.nav-profile-btn:hover .nav-profile-avatar {
  border-color: rgba(255, 193, 7, 0.7);
}

.nav-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-profile-name {
  font-weight: 500;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-profile-menu {
  min-width: 280px;
  max-width: calc(100vw - 2rem);
  padding: 0;
  background: #2b3035;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.nav-profile-menu .dropdown-header {
  padding: 1rem;
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.08) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-profile-avatar-lg {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 193, 7, 0.4);
  flex-shrink: 0;
}

.nav-profile-avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-profile-menu .dropdown-item {
  padding: 0.6rem 1rem;
  color: rgba(255, 255, 255, 0.85);
  transition: all 0.15s ease;
}

.nav-profile-menu .dropdown-item:hover {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}

.nav-profile-menu .dropdown-item i {
  width: 20px;
  opacity: 0.7;
}

.nav-profile-menu .dropdown-item:hover i {
  opacity: 1;
}

.nav-profile-menu .dropdown-divider {
  margin: 0.25rem 0;
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-profile-menu .dropdown-item.text-danger:hover {
  background: rgba(220, 53, 69, 0.15);
  color: #dc3545;
}

/* ============================================
   SWEETALERT2 DARK THEME
   ============================================ */

/* Override SweetAlert2 default styles for Bootstrap dark theme */
[data-bs-theme="dark"] .swal2-popup {
  background: #2b3035 !important;
  color: #e9ecef !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

[data-bs-theme="dark"] .swal2-title {
  color: #e9ecef !important;
}

[data-bs-theme="dark"] .swal2-html-container {
  color: rgba(255, 255, 255, 0.7) !important;
}

[data-bs-theme="dark"] .swal2-icon.swal2-warning {
  border-color: #ffc107 !important;
  color: #ffc107 !important;
}

[data-bs-theme="dark"] .swal2-icon.swal2-error {
  border-color: #dc3545 !important;
  color: #dc3545 !important;
}

[data-bs-theme="dark"] .swal2-icon.swal2-success {
  border-color: #198754 !important;
  color: #198754 !important;
}

[data-bs-theme="dark"] .swal2-icon.swal2-success .swal2-success-ring {
  border-color: rgba(25, 135, 84, 0.3) !important;
}

[data-bs-theme="dark"] .swal2-icon.swal2-success [class^='swal2-success-line'] {
  background-color: #198754 !important;
}

[data-bs-theme="dark"] .swal2-icon.swal2-info {
  border-color: #0dcaf0 !important;
  color: #0dcaf0 !important;
}

[data-bs-theme="dark"] .swal2-icon.swal2-question {
  border-color: #6c757d !important;
  color: #6c757d !important;
}

[data-bs-theme="dark"] .swal2-input,
[data-bs-theme="dark"] .swal2-textarea,
[data-bs-theme="dark"] .swal2-select {
  background-color: #1a1d21 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #e9ecef !important;
}

[data-bs-theme="dark"] .swal2-input:focus,
[data-bs-theme="dark"] .swal2-textarea:focus,
[data-bs-theme="dark"] .swal2-select:focus {
  border-color: #ffc107 !important;
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2) !important;
}

[data-bs-theme="dark"] .swal2-validation-message {
  background: rgba(220, 53, 69, 0.1) !important;
  color: #dc3545 !important;
}

[data-bs-theme="dark"] .swal2-footer {
  border-top-color: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.6) !important;
}

[data-bs-theme="dark"] .swal2-timer-progress-bar {
  background: rgba(255, 193, 7, 0.4) !important;
}

/* Toast specific dark styles */
[data-bs-theme="dark"] .swal2-popup.swal2-toast {
  background: #2b3035 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ============================================
   UNIFIED PAGINATION DARK THEME
   ============================================ */

[data-bs-theme="dark"] .pagination .page-link {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s ease;
}

[data-bs-theme="dark"] .pagination .page-link:hover {
  background: rgba(255, 193, 7, 0.15);
  border-color: rgba(255, 193, 7, 0.3);
  color: #ffc107;
}

[data-bs-theme="dark"] .pagination .page-link:focus {
  box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.2);
}

[data-bs-theme="dark"] .pagination .page-item.active .page-link {
  background: #ffc107;
  border-color: #ffc107;
  color: #000;
}

[data-bs-theme="dark"] .pagination .page-item.disabled .page-link {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   UNIFIED MODAL DARK THEME
   ============================================ */

[data-bs-theme="dark"] .modal-content {
  background: #2b3035;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] .modal-header {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.08) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.25rem;
}

[data-bs-theme="dark"] .modal-title {
  color: #e9ecef;
  font-weight: 600;
}

[data-bs-theme="dark"] .modal-body {
  padding: 1.25rem;
  color: #e9ecef;
}

[data-bs-theme="dark"] .modal-footer {
  background: rgba(0, 0, 0, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1.25rem;
}

[data-bs-theme="dark"] .modal-header .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

[data-bs-theme="dark"] .modal-header .btn-close:hover {
  opacity: 1;
}

/* Modal form inputs - let Bootstrap dark theme handle colors */

/* Modal input-group-text - uses global unified styles */

/* Modal backdrop */
[data-bs-theme="dark"] .modal-backdrop {
  background-color: #000;
}

[data-bs-theme="dark"] .modal-backdrop.show {
  opacity: 0.7;
}

/* Fix modal z-index layering */
.modal {
  z-index: 1055;
}

.modal-backdrop {
  z-index: 1050;
}

.modal-dialog {
  z-index: 1056;
}

/* === CATEGORY BUILDER PANEL === */
.category-builder-panel {
  background: linear-gradient(135deg, rgba(33, 37, 41, 0.95) 0%, rgba(33, 37, 41, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.25rem;
}

.category-builder-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.category-builder-panel .panel-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-builder-panel .panel-header-title i {
  color: #ffc107;
  font-size: 1.1rem;
}

.category-builder-panel .panel-header-title span {
  font-weight: 600;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}

.category-builder-panel .panel-header-hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

.category-builder-panel .form-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.category-builder-panel .form-control,
.category-builder-panel .form-select {
  font-size: 0.875rem;
}

.category-builder-panel .input-group-text {
  font-size: 0.75rem;
}

/* Custom weight input - fix border-radius when select is hidden */
#customWeightInput:not(.d-none) {
  border-top-left-radius: var(--bs-border-radius) !important;
  border-bottom-left-radius: var(--bs-border-radius) !important;
}

/* Quick presets section */
.category-builder-panel .quick-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(255, 193, 7, 0.05);
  border: 1px dashed rgba(255, 193, 7, 0.2);
  border-radius: 8px;
}

.category-builder-panel .quick-presets-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.category-builder-panel .quick-presets-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-builder-panel .quick-presets .btn {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
}

.category-builder-panel .quick-presets .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
}

.category-builder-panel .quick-presets .btn-outline-light:hover {
  background: rgba(255, 193, 7, 0.15);
  border-color: rgba(255, 193, 7, 0.3);
  color: #ffc107;
}

/* Custom age group section */
.category-builder-panel .custom-age-section {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
}

.category-builder-panel .custom-age-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.65rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-builder-panel .custom-age-toggle:hover {
  background: rgba(0, 0, 0, 0.3);
  color: #ffc107;
}

.category-builder-panel .custom-age-toggle i.bi-stars {
  color: #ffc107;
}

.category-builder-panel .custom-age-toggle .toggle-chevron {
  transition: transform 0.2s ease;
}

.category-builder-panel .custom-age-toggle[aria-expanded="true"] .toggle-chevron {
  transform: rotate(180deg);
}

.category-builder-panel .custom-age-form {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.category-builder-panel .custom-age-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-builder-panel .custom-age-list:empty {
  display: none;
}

.category-builder-panel .custom-age-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  background: linear-gradient(135deg, rgba(13, 202, 240, 0.2) 0%, rgba(13, 202, 240, 0.1) 100%);
  border: 1px solid rgba(13, 202, 240, 0.3);
  border-radius: 6px;
  font-size: 0.75rem;
  color: #0dcaf0;
}

.category-builder-panel .custom-age-badge .btn-close {
  font-size: 0.5em;
  filter: invert(1);
  opacity: 0.6;
}

.category-builder-panel .custom-age-badge .btn-close:hover {
  opacity: 1;
}

/* Selected categories section */
.category-builder-panel .selected-categories-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.category-builder-panel .selected-categories-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.category-builder-panel .selected-categories-header i {
  color: #198754;
}

.category-builder-panel .selected-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.35rem;
  background: rgba(25, 135, 84, 0.2);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #198754;
}

.category-builder-panel .selected-categories-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 2rem;
}

.category-builder-panel .selected-categories-list:empty + .no-categories-hint {
  display: flex;
}

.category-builder-panel .no-categories-hint {
  display: none;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

.category-builder-panel .category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.category-builder-panel .category-badge.standard {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 193, 7, 0.1) 100%);
  border: 1px solid rgba(255, 193, 7, 0.3);
  color: #ffc107;
}

.category-builder-panel .category-badge.custom {
  background: linear-gradient(135deg, rgba(13, 202, 240, 0.2) 0%, rgba(13, 202, 240, 0.1) 100%);
  border: 1px solid rgba(13, 202, 240, 0.3);
  color: #0dcaf0;
}

.category-builder-panel .category-badge .btn-close {
  font-size: 0.5em;
  filter: invert(1);
  opacity: 0.6;
  margin-left: 0.25rem;
}

.category-builder-panel .category-badge .btn-close:hover {
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .category-builder-panel .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .category-builder-panel .quick-presets {
    flex-direction: column;
    align-items: flex-start;
  }

  .category-builder-panel .quick-presets-buttons {
    width: 100%;
  }

  .category-builder-panel .quick-presets .btn {
    flex: 1;
    min-width: 0;
  }
}
