:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #132039;
  --muted: #657089;
  --primary: #1e63ff;
  --success: #219653;
  --warning: #ff9f1c;
  --danger: #e63946;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(19, 32, 57, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app-shell {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: 84px;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  background: rgba(245, 247, 251, 0.95);
  backdrop-filter: blur(4px);
  z-index: 30;
}

#teamSwitcher,
input,
select,
textarea {
  border: 1px solid #d6ddea;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  font: inherit;
}

.team-switcher {
  flex: 1;
  margin-right: 8px;
}

#teamSwitcher {
  width: 100%;
}

.icon-btn {
  border: none;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px;
}

.content {
  padding: 8px 14px 26px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.card.clickable {
  cursor: pointer;
}

.team-cover {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 12px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.small {
  font-size: 0.86rem;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge.active,
.badge.paid,
.badge.going {
  background: #dff7e8;
  color: #166534;
}

.badge.off,
.badge.pending,
.badge.maybe {
  background: #fff3db;
  color: #9a6700;
}

.badge.notgoing {
  background: #ffe4e7;
  color: #b42318;
}

.badge.role-player {
  background: #e8f1ff;
  color: #1d4ed8;
}

.badge.role-coach {
  background: #f2e8ff;
  color: #7e22ce;
}

.badge.role-admin {
  background: #d9f6ff;
  color: #0f766e;
}

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

button,
.btn {
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
}

button.secondary,
.btn.secondary {
  background: #e4e9f5;
  color: #1d2f55;
}

button.ghost {
  background: #f4f7ff;
  color: #24417d;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 760px;
  margin: 0 auto;
  background: white;
  box-shadow: 0 -8px 24px rgba(16, 26, 43, 0.12);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 35;
}

.nav-item {
  background: transparent;
  color: #5e6c86;
  border-radius: 0;
  padding: 9px 2px;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

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

.fab {
  position: fixed;
  right: max(calc(50% - 360px), 14px);
  bottom: 78px;
  border-radius: 999px;
  width: 56px;
  height: 56px;
  font-size: 1.6rem;
  box-shadow: var(--shadow);
  z-index: 40;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list > li {
  padding: 10px 0;
  border-bottom: 1px solid #eef2fb;
}

.list > li:last-child {
  border-bottom: none;
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #ecf1fc;
  font-size: 0.9rem;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.form-section {
  margin-bottom: 14px;
}

.form-section h3 {
  margin-bottom: 8px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.field-grid.two {
  grid-template-columns: 1fr 1fr;
}

label {
  font-size: 0.83rem;
  font-weight: 700;
  color: #243a66;
}

textarea {
  min-height: 90px;
}

dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  width: calc(100% - 36px);
  max-width: 360px;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.dialog-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.timeline-item {
  border-left: 3px solid #dce6ff;
  padding-left: 10px;
  margin: 8px 0;
}

@media (min-width: 740px) {
  .content {
    padding: 12px 18px 32px;
  }

  .field-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
