:root {
  --orange: #ef7f2d;
  --bg: #0f1116;
  --card: #161a22;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #1f2532;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1100px, 90%);
  margin: 0 auto;
  padding: 1.5rem 0;
}

.header {
  border-bottom: 1px solid var(--border);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--orange);
}

.logo img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: contain;
  background: var(--card);
}

.nav a {
  margin-left: 1rem;
  color: var(--muted);
}

.nav a:hover {
  color: var(--orange);
}

.hero h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
}

.login {
  display: grid;
  place-items: center;
  min-height: 60vh;
}

.login__card {
  max-width: 520px;
  width: 100%;
  text-align: center;
}

.login__card h1 {
  margin: 0 0 0.75rem 0;
}

.login__hint {
  color: var(--muted);
  margin-bottom: 1rem;
}

.login__widget {
  margin: 1rem 0;
}

.login__note {
  color: var(--muted);
  font-size: 0.9rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.filters {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
  align-items: end;
}

.filters__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.filters select,
.filters input {
  background: #0f141f;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
}

.filters__submit {
  background: var(--orange);
  color: #111;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.teams {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
}

.team-card__header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.team-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--orange);
}

.team-card__summary {
  color: var(--muted);
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

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

.teams-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  table-layout: fixed;
}

.teams-table th,
.teams-table td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.45rem;
  font-size: 0.9rem;
}

.teams-table th:not(:first-child),
.teams-table td:not(:first-child) {
  text-align: center;
}

.teams-col--name {
  width: 220px;
}

.teams-col--metric {
  width: 110px;
}

.teams-col--period {
  width: 120px;
}

.teams-table thead th {
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--card);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.card__title {
  font-size: 0.95rem;
  color: var(--muted);
}

.card__value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--orange);
}

.stats__list {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.75rem;
}

.stats__item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
}

.stats__item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.stats__label {
  color: var(--muted);
  font-size: 0.95rem;
}

.stats__value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--orange);
}

.stats__bar {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.stats__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(239, 127, 45, 0.5), var(--orange));
}

.card--wide .card__meta div {
  margin-bottom: 0.25rem;
}

.list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.teams-users {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.team-users__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-weight: 700;
  color: var(--text);
}

.team-users__summary::-webkit-details-marker {
  display: none;
}

.team-users__name {
  color: var(--orange);
}

.team-users__count {
  color: var(--muted);
  font-size: 0.9rem;
}

.list__item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem;
  display: block;
}

.list__item:hover {
  border-color: var(--orange);
}

.list__title {
  font-weight: 700;
}

.list__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.training {
  margin-top: 1rem;
}

.training__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.training__title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.training__meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.training__icon {
  font-size: 1.1rem;
}

.feed {
  margin-top: 2rem;
}

.feed h2 {
  margin-bottom: 0.75rem;
}

.feed__list {
  display: grid;
  gap: 0.75rem;
}

.feed__item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.feed__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.feed__title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.feed__date {
  color: var(--muted);
  font-size: 0.9rem;
}

.feed__meta {
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.feed__user {
  color: var(--muted);
  font-size: 0.9rem;
}

.training__details {
  display: flex;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.training__photo img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 0.3rem;
  cursor: zoom-in;
}

.training__details-box summary {
  cursor: pointer;
  color: var(--orange);
  margin-bottom: 0.4rem;
}

.training__photos {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.training__photo {
  flex: 1 1 240px;
  max-width: 320px;
}

.photo-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
}

.photo-modal[hidden] {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

.photo-modal__image {
  max-width: min(1200px, 95vw);
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.photo-modal__close {
  position: fixed;
  top: 20px;
  right: 24px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.empty {
  margin-top: 1rem;
  color: var(--muted);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  color: var(--muted);
}
