body {
  font-family: sans-serif;
  background-color: #f5f5f5;
  margin: 0px;
  padding: 0px;
}

main {
  margin-left: 220px;
  padding: 20px;
  display: flex;
  min-height: 100vh;
}

main.team-main,
main.admin-main {
  padding-top: 10px;
}

main.setup-main {
  margin-left: 0;
  padding: 0;
  display: block;
  height: 100vh;
  overflow: hidden;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  background-color: #AA0000;
  color: white;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 200px;
  height: 100vh;
  overflow-y: auto;
  scrollbar-gutter: stable;
  box-sizing: border-box;
}

.nav .nav-title-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-bottom: 4px;
}

.nav .nav-simulation-name {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  text-align: center;
  word-break: break-word;
  margin-top: -8px;
  margin-bottom: 8px;
  padding: 0 8px;
}

.nav .nav-link {
  display: block;
  box-sizing: border-box;
  color: white;
  text-decoration: none;
  margin: 5px 0;
  font-size: 18px;
  width: 100%;
  text-align: center;
  border-radius: 15px;
  padding: 5px;
  outline: none;
}

.nav .nav-link:hover {
  background-color: black;
  text-decoration: none;
}

.nav-bottom {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nav-stats {
  width: 100%;
  padding: 0.6rem 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nav-stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.nav-stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.nav .nav-logout-form {
  margin-top: 0;
  margin-bottom: 8px;
  width: 200px;
  max-width: none;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.nav .nav-logout-btn {
  -webkit-appearance: none;
  appearance: none;
  color: white;
  background-color: transparent;
  border: 2px solid white;
  text-decoration: none;
  margin: 5px 0;
  font-size: 18px;
  width: 100%;
  text-align: center;
  border-radius: 15px;
  padding: 5px;
  cursor: pointer;
}

.nav .nav-logout-btn:hover {
  background-color: black;
}

@media (max-width: 1024px) {
  main {
    margin-left: 180px;
  }
  .nav {
    width: 160px;
  }
  .nav .nav-link {
    width: 100%;
    font-size: 16px;
  }
  .nav .nav-logout-form {
    width: 160px;
  }
}

@media (max-width: 768px) {
  main {
    margin-left: 0;
    padding: 15px;
  }
  .nav {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    justify-content: space-around;
    padding: 10px 10px;
  }

  .nav .nav-link {
    width: auto;
    margin: 0 5px;
    padding: 8px 12px;
    font-size: 14px;
  }
  .nav .nav-link:hover {
    background-color: black;
  }

  .nav-bottom {
    margin-top: 0;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    width: auto;
  }

  .nav-stats {
    flex-direction: row;
    gap: 0.75rem;
    border-top: none;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 0;
    padding: 0 0.5rem;
    width: auto;
  }

  .nav .nav-logout-form {
    width: auto;
    margin-top: 0;
  }
}

@media (max-width: 480px) {
  .nav {
    flex-wrap: wrap;
    width: 100%;
    height: auto;
    padding: 10px 0;
  }

  .nav .nav-link {
    font-size: 12px;
    padding: 6px 10px;
  }
}

/* Flash popup styles */
.flash-popup {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 400px;
  animation: slideIn 0.3s ease-out;
}

.flash-popup button {
  float: right;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  margin-left: 10px;
}

.alert-notice {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-alert {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ── Team notification modal ── */
.team-notification-dialog {
  border: none;
  border-radius: 0.875rem;
  padding: 0;
  width: min(480px, 92vw);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: tnFadeIn 0.2s ease-out;
}

.team-notification-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  animation: tnBackdropIn 0.2s ease-out;
}

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

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

.tn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: #AA0000;
}

.tn-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tn-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.tn-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}

.tn-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  transition: background 0.15s;
}

.tn-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.tn-body {
  padding: 1.25rem 1.5rem;
  background: #fff;
}

.tn-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tn-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.925rem;
  color: #374151;
  line-height: 1.55;
}

.tn-list li::before {
  content: "•";
  color: #AA0000;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.05em;
}

.tn-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 1.5rem 1.25rem;
  background: #fff;
}

.tn-ok-btn {
  padding: 0.45rem 1.25rem;
  border: none;
  border-radius: 0.4rem;
  background: #AA0000;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.tn-ok-btn:hover {
  background: #880000;
}