:root {
  --accent: #1976d2;
  --bg: #f6f6f6;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  background: var(--bg);
  color: #111;
}

.topbar {
  background: var(--accent);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-links a {
  color: #fff;
  text-decoration: underline;
  font-size: 14px;
}

/* NAVBAR */

.navbar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: #ffffff;
  border-bottom: 1px solid #ddd;
}

.navbar button,
.navbar a {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  text-align: center;
  font-size: 14px;
  text-decoration: none;
  color: #111;
  cursor: pointer;
}

.navbar .nav-logout {
  flex: 0 0 auto;
  width: auto;
  white-space: nowrap;
  background: #e53935;
  color: #fff;
  border-color: #c62828;
}

/* Active nav state */
.navbar .nav-button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* LAYOUT */

#root,
.content {
  padding: 12px;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  margin: 12px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

input,
select,
button {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 14px;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
}

.row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.row button {
  flex: 1;
}

.hidden {
  display: none;
}

/* LOGIN vs APP STACKING */

#authCard {
  position: relative !important;
  z-index: 9999 !important;
  background: #fff;
}

#app {
  position: relative;
  z-index: 1;
}

.view-section {
  position: relative;
  z-index: 1;
}

/* SWIMMERS & RESULTS */

.swimmerCard {
  padding: 8px;
  border-radius: 8px;
  background: #f8f9fb;
  margin-bottom: 8px;
}

.resultRow {
  padding: 8px;
  border-radius: 6px;
  background: #fff;
  margin-bottom: 6px;
  border-left: 4px solid var(--accent);
}

.small {
  font-size: 12px;
}

.muted {
  color: #666;
}

/* Headings in PB + Results */

.date-header {
  margin: 0 0 4px;
}

.swimmer-header {
  margin: 16px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #ddd;
}

.event-name {
  font-size: 14px;
  font-weight: normal;
  color: #444;
}

/* Filters layout */

.filters-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-item {
  flex: 1 1 140px;
}

.filters-clear {
  display: inline-block;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  text-decoration: none;
  text-align: center;
  font-size: 14px;
  background: #f5f5f5;
  color: #111;
}

/* Back-to-top button */

.back-to-top {
  position: fixed;
  bottom: 16px;
  right: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  font-size: 13px;
  cursor: pointer;
  display: none;
}
