:root {
  --tk-bg: #eef6f5;
  --tk-ink: #073b43;
  --tk-muted: #526f75;
  --tk-primary: #14b8a6;
  --tk-primary-dark: #0f766e;
  --tk-deep: #064f54;
  --tk-gold: #e6b238;
  --tk-white: #fff;
  --tk-radius-xl: 28px;
  --tk-radius-lg: 24px;
  --tk-shadow: 0 18px 48px rgba(7, 52, 58, .13);
  --tk-container: 1380px;
}

html { font-family: "LINE Seed Sans TH", "Noto Sans Thai", sans-serif; }
body.subpage-theme {
  margin: 0;
  min-height: 100vh;
  color: var(--tk-ink);
  background: var(--tk-bg);
  overflow-x: hidden;
  display: block;
  font-family: "LINE Seed Sans TH", "Noto Sans Thai", "Kanit", sans-serif;
}

/* Full-width visual background behind navbar + hero + search */
.subpage-scene {
  position: absolute;
  inset: 0 0 auto;
  height: clamp(650px, 74vh, 860px);
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.subpage-scene__image {
  position: absolute;
  inset: 0;
  background-image: url("../img/subpage-campus-sport-bg.png");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  transform: scale(1.01);
}
.subpage-scene__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(238,249,248,.10) 0%, rgba(236,248,247,.24) 34%, rgba(238,246,245,.86) 80%, var(--tk-bg) 100%),
    linear-gradient(90deg, rgba(255,255,255,.88) 0%, rgba(255,255,255,.58) 43%, rgba(5,89,90,.08) 70%, rgba(5,74,78,.16) 100%);
}
.subpage-scene__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 28%, rgba(80,239,223,.18), transparent 30%),
    radial-gradient(circle at 87% 22%, rgba(232,178,56,.12), transparent 26%);
}

.site-header,
.subpage-main { position: relative; z-index: 2; }
.site-header {
  width: min(1480px, calc(100% - 48px));
  margin: 18px auto 0;
}
.site-navbar {
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 92px;
  display: flex;
  align-items: center;
  padding: 12px 24px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 28px;
  box-shadow: 0 16px 42px rgba(6,56,61,.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.site-navbar .container-fluid { gap: 18px; }
.site-navbar .navbar-brand { min-width: 300px; }
.site-navbar .navbar-nav { align-items: center; gap: 4px; }
.site-navbar.navbar-dark .navbar-nav .nav-link {
  color: var(--tk-ink);
  font-weight: 800;
}
.site-navbar.navbar-dark .navbar-nav .nav-link.active,
.site-navbar.navbar-dark .navbar-nav .nav-link:hover {
  color: var(--tk-primary-dark);
  background: rgba(20,184,166,.09);
}
.site-navbar .nav-login {
  color: #fff !important;
  background: linear-gradient(135deg, var(--tk-primary-dark), var(--tk-primary)) !important;
  box-shadow: 0 14px 28px rgba(15,118,110,.25);
}

.subpage-main {
  width: min(var(--tk-container), calc(100% - 48px));
  margin-inline: auto;
  padding-bottom: 72px;
}

/* Hero text sits directly on background; no giant white banner */
.subpage-hero {
  position: relative;
  min-height: 220px;
  display: flex;
  align-items: center;
  padding: clamp(44px, 6vw, 82px) clamp(24px, 5vw, 72px) 28px;
}
.subpage-hero::before {
  content: "";
  position: absolute;
  inset: 10px 34% 0 0;
  border-radius: 30px;
  background: linear-gradient(90deg, rgba(255,255,255,.96), rgba(255,255,255,.72) 58%, rgba(255,255,255,0));
  z-index: -1;
}
.page-eyebrow { margin: 0 0 8px; color: var(--tk-primary-dark); font-weight: 800; }
.page-title {
  margin: 0;
  color: var(--tk-ink);
  font-size: clamp(3rem, 5.4vw, 5.6rem);
  line-height: 1.06;
  font-weight: 900;
}
.page-description {
  margin: 12px 0 0;
  color: var(--tk-muted);
  font-size: clamp(1rem, 1.35vw, 1.28rem);
  line-height: 1.65;
  font-weight: 500;
}
.event-name-nowrap {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}
.page-title .event-name-nowrap {
  font-size: clamp(1.55rem, 3vw, 3.05rem);
  line-height: 1.22;
  vertical-align: baseline;
}

/* Search/filter bar */
.search-filter-panel {
  position: relative;
  z-index: 4;
  margin-top: 8px;
  padding: 20px 24px;
  color: #fff;
  border: 1px solid rgba(142,255,241,.24);
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(5,73,76,.97), rgba(17,123,117,.93));
  box-shadow: 0 18px 46px rgba(5,54,58,.20), inset 0 1px 0 rgba(255,255,255,.15);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.search-filter-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.8fr) repeat(4, minmax(130px, .65fr)) auto auto;
  gap: 14px;
  align-items: end;
}
.search-filter-panel label { display: block; margin: 0 0 7px; font-weight: 700; }
.filter-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-weight: 900;
  font-size: 1.15rem;
}
.search-filter-panel input,
.search-filter-panel select,
.search-filter-panel button {
  min-height: 54px;
  border-radius: 16px;
  font: inherit;
}
.search-filter-panel input {
  width: 100%;
  box-sizing: border-box;
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,.28);
  background: #fff;
  color: var(--tk-ink);
}
.search-filter-panel select {
  width: 100%;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.26);
  background: rgba(255,255,255,.14);
  color: #fff;
}
.search-filter-panel select option {
  color: var(--tk-ink, #333);
  background: #fff;
}
.search-filter-panel button {
  padding: 0 20px;
  border: 0;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--tk-primary), var(--tk-primary-dark));
  box-shadow: 0 8px 22px rgba(2,61,64,.22);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.stat-card,
.data-card {
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(255,255,255,.82);
  box-shadow: var(--tk-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.stat-card {
  min-height: 132px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border-radius: var(--tk-radius-lg);
}
.stat-card p {
  margin: 0 0 6px;
  color: var(--tk-muted);
  font-weight: 700;
}
.stat-card h3 {
  margin: 0 0 6px;
  color: var(--tk-ink);
  font-size: 1.14rem;
  font-weight: 900;
}
.stat-card h3 + p { margin: 0; line-height: 1.55; }
.stat-icon {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--tk-primary), var(--tk-primary-dark));
  box-shadow: 0 10px 24px rgba(9,118,110,.24);
}
.stat-card.is-gold .stat-icon { background: linear-gradient(135deg, #f5d875, #d89c16); }
.stat-number {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
  font-size: clamp(2rem, 3vw, 3.3rem);
  line-height: 1;
  font-weight: 900;
}
.stat-number small { font-size: .42em; }
.stat-label {
  color: var(--tk-primary-dark);
  font-size: clamp(1.15rem, 1.6vw, 1.55rem);
  line-height: 1.25;
  font-weight: 900;
}

.data-card {
  margin-top: 18px;
  padding: 22px;
  border-radius: 26px;
}
.data-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.data-panel-head h2 {
  margin: 0;
  color: var(--tk-ink);
  font-size: clamp(1.28rem, 2vw, 1.8rem);
  font-weight: 900;
}
.data-count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--tk-primary-dark);
  background: rgba(20,184,166,.12);
  font-weight: 900;
}
.data-card + .data-card,
.prize-section { margin-top: 18px; }
.data-table-wrap { overflow-x: auto; border-radius: 18px; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; }
.data-table thead { color: #fff; background: linear-gradient(135deg, var(--tk-deep), var(--tk-primary-dark)); }
.data-table th,
.data-table td { padding: 15px 18px; text-align: left; }
.data-table tbody tr { border-bottom: 1px solid rgba(7,59,67,.08); }
.data-table tbody tr:hover { background: #f3fbfa; }
.data-card .form-control,
.data-card .form-select,
.data-card textarea {
  min-height: 50px;
  border-color: rgba(7,59,67,.16);
  border-radius: 16px;
}
.data-card .btn {
  min-height: 50px;
  border-radius: 999px;
}
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Activity overview cards */
.activity-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: stretch;
    margin-top: 18px;
}

.activity-card {
    position: relative;
    overflow: hidden;
    min-height: 260px;
    padding: 30px;
    border: 1px solid rgba(7, 93, 98, 0.08);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 48px rgba(7, 52, 58, 0.10);
    transition: transform .25s ease, box-shadow .25s ease;
}

.activity-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    height: 4px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, #14b8a6, #5de6da);
}

.activity-card--gold::before {
    background: linear-gradient(90deg, #d49a19, #f5d875);
}

.activity-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 56px rgba(7, 52, 58, 0.15);
}

.activity-card__icon {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    margin-bottom: 22px;
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(145deg, #18b9aa, #08766e);
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.25);
}

.activity-card__icon i {
    font-size: 32px;
}

.activity-card--gold .activity-card__icon {
    background: linear-gradient(145deg, #f6d76c, #dda319);
    box-shadow: 0 12px 24px rgba(221, 163, 25, 0.25);
}

.activity-card h3 {
    margin: 0 0 12px;
    color: #073b43;
    font-size: clamp(1.3rem, 1.7vw, 1.65rem);
    line-height: 1.35;
    font-weight: 800;
}

.activity-card p, .activity-card ul {
    margin: 0;
    color: #587078;
    font-size: 1rem;
    line-height: 1.75;
}
.activity-round {
  display: inline;
  font-weight: 900;
}
.activity-round--group { color: #08766e; }
.activity-round--final { color: #b77a00; }
.activity-location {
  color: #073b43;
  font-weight: 900;
}
.activity-location i { color: #b77a00; }
.activity-highlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
  padding: clamp(24px, 4vw, 32px);
  border-radius: 16px;
  color: #fff;
  background: var(--tk-deep);
}
.activity-highlight__eyebrow {
  display: none;
}
.activity-highlight h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  font-weight: 800;
}
.activity-highlight > div > p:last-child {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, .9);
  font-size: 1rem;
}
.activity-highlight__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}
.activity-highlight .btn {
  min-height: 44px;
  padding-inline: 24px;
  border-radius: 12px;
  font-weight: 600;
  background: var(--tk-primary-dark);
  border-color: var(--tk-primary-dark);
  color: #fff;

  font-weight: 800;
}
.activity-highlight .btn-primary {
  background: linear-gradient(135deg, #f5d875, #d49a19) !important;
  color: #073b43 !important;
  box-shadow: 0 12px 26px rgba(3, 45, 48, .22);
}
.activity-highlight .btn-outline-primary {
  border-color: rgba(255, 255, 255, .68);
  color: #fff;
  background: rgba(255, 255, 255, .08);
}
.activity-highlight .btn-outline-primary:hover {
  border-color: #fff;
  color: #073b43;
  background: #fff;
}
.schedule-setup {
  padding: 22px;
  border: 1px solid rgba(20, 184, 166, .18);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(221, 249, 245, .72), rgba(255, 255, 255, .92));
}
.team-member-summary {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}
.team-member-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 1.5rem;
  color: var(--tk-muted);
}
.team-member-list li::marker { color: var(--tk-primary-dark); font-weight: 900; }
.alert.narrow,
.data-card.narrow {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}
.alert.narrow { margin-top: 8px; }

/* One vertical rhythm for every public and admin page. */
.subpage-main > .admin-page-title {
  margin: 0;
  padding: 26px 0 18px;
  color: var(--tk-ink);
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  line-height: 1.2;
  font-weight: 900;
  text-align: center;
}
.subpage-hero { padding-bottom: 30px; }
.page-eyebrow { margin-bottom: 6px; line-height: 1.35; }
.page-title { line-height: 1.12; text-wrap: balance; }
.page-description { margin-top: 10px; line-height: 1.55; text-wrap: balance; }
.data-card h2,
.data-card h3,
.data-card h4,
.data-card h5 { line-height: 1.3; }
.data-card h4,
.data-card h5 { margin-top: 0; }
.data-card .form-label { margin-bottom: 6px; line-height: 1.4; }
.data-card .form-text,
.data-card .text-muted { line-height: 1.5; }
.stat-card p,
.stat-label { line-height: 1.35; }
.contact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.contact-grid .stat-label a { display: inline-block; line-height: 1.35; overflow-wrap: anywhere; }

@media (max-width: 1399px) {
  .subpage-scene { height: 780px; }
  .site-header { width: min(980px, calc(100% - 32px)); }
  .site-navbar .navbar-brand { min-width: auto; }
  .site-navbar .navbar-collapse {
    max-height: calc(100vh - 128px);
    overflow: auto;
  }
  .site-navbar .navbar-nav {
    align-items: stretch;
    padding-top: 12px;
  }
  .site-navbar.navbar-dark .navbar-nav .nav-link {
    min-height: 48px;
    justify-content: flex-start;
  }
  .search-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-field-group { grid-column: 1 / -1; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-highlight { align-items: flex-start; flex-direction: column; }
  .subpage-hero::before { inset-right: 18%; }
}

@media (max-width: 767px) {
  .site-header,
  .subpage-main { width: calc(100% - 28px); }
  .site-navbar .container-fluid { gap: 8px; }
  .site-navbar .navbar-brand {
    flex: 1 1 auto;
    max-width: calc(100% - 68px);
    min-width: 0;
    margin-right: 0;
  }
  .site-navbar .navbar-brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
  }
  .site-navbar .brand-copy strong { font-size: .82rem; }
  .site-navbar .brand-copy small { display: none; }
  .site-navbar .navbar-toggler {
    flex: 0 0 auto;
    margin-left: auto;
  }
  .subpage-scene { height: 700px; }
  .subpage-scene__image { background-position: 62% top; }
  .subpage-hero { min-height: 210px; padding: 34px 18px 22px; }
  .subpage-hero::before { inset: 8px 0 0; background: rgba(255,255,255,.78); }
  .page-title { font-size: clamp(2.2rem, 11vw, 3.5rem); }
  .page-title .event-name-nowrap { font-size: clamp(1.08rem, 4.65vw, 1.42rem); }
  .page-description { font-size: clamp(.78rem, 3.4vw, 1rem); }
  .subpage-main > .admin-page-title { padding: 18px 0 14px; }
  .search-filter-grid,
  .stats-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .activity-cards { grid-template-columns: 1fr; gap: 16px; }
  .activity-card { min-height: 0; padding: 26px; }
  .activity-highlight { gap: 20px; padding: 28px 24px; }
  .activity-highlight__actions { width: 100%; }
  .activity-highlight .btn { width: 100%; justify-content: center; }
  .search-filter-panel { padding: 18px; }
  .stat-card { min-height: 110px; }
  .data-panel-head { align-items: flex-start; flex-direction: column; }
  .data-table-wrap { overflow: visible; }
}
