* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-deep: #061428;
  --bg-mid: #0c2d5e;
  --panel: #ffffff;
  --panel-border: #f5c518;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --accent: #0ea5e9;
  --accent-dark: #0369a1;
  --success: #16a34a;
  --pending: #ea580c;
  --stat-bg: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
  --table-head: linear-gradient(90deg, #0a2463 0%, #0e7490 55%, #0891b2 100%);
  --wc-pink: #ff6b9d;
  --wc-gold: #f5c518;
  --wc-green: #22c55e;
  --wc-blue: #38bdf8;
}

body {
  font-family: "Outfit", "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(165deg, var(--bg-deep) 0%, var(--bg-mid) 38%, #134074 70%, #1a5080 100%);
  min-height: 100vh;
  color: var(--text-dark);
  position: relative;
}

/* Subtle pitch pattern */
.bg-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.06;
  background-image:
    linear-gradient(0deg, transparent 49%, #fff 49%, #fff 51%, transparent 51%),
    linear-gradient(90deg, transparent 49%, #fff 49%, #fff 51%, transparent 51%);
  background-size: 80px 80px;
}
.bg-pattern::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(56,189,248,.25), transparent 60%);
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-hero,
.top-nav,
.page-wrap,
.site-footer { position: relative; z-index: 1; }

/* Hero */
.site-hero {
  padding: 1.5rem 1rem 1rem;
  color: #fff;
}
.hero-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.hero-logo {
  width: 130px;
  height: 130px;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.35));
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.hero-text { text-align: left; }
.hero-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .28rem .7rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,107,157,.35), rgba(56,189,248,.35));
  border: 1px solid rgba(255,255,255,.25);
  margin-bottom: .5rem;
  color: #f8fafc;
}
.site-hero h1 {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 3px 12px rgba(0,0,0,.3);
  letter-spacing: -.01em;
}
.site-hero h1 .year {
  background: linear-gradient(90deg, var(--wc-gold), #fde68a, var(--wc-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  margin-top: .4rem;
  font-size: .92rem;
  color: #cbd5e1;
  font-weight: 500;
}

/* Nav */
.top-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .45rem .65rem;
  padding: 0 1rem 1.1rem;
  max-width: 720px;
  margin: 0 auto;
}
.top-nav a {
  color: #e2e8f0;
  font-size: .88rem;
  font-weight: 600;
  padding: .45rem .85rem;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(8px);
  transition: all .2s ease;
}
.top-nav a:hover,
.top-nav a.active {
  background: rgba(255,255,255,.2);
  border-color: rgba(245,197,24,.45);
  text-decoration: none;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.top-nav a.nav-logout {
  background: rgba(239,68,68,.15);
  border-color: rgba(248,113,113,.3);
}
.top-nav a.nav-logout:hover { background: rgba(239,68,68,.28); }

/* Main panel */
.page-wrap {
  max-width: 1060px;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
}
.panel {
  background: var(--panel);
  border-radius: 20px;
  border-top: 5px solid transparent;
  border-image: linear-gradient(90deg, var(--wc-pink), var(--wc-gold), var(--wc-green), var(--wc-blue)) 1;
  box-shadow:
    0 24px 60px rgba(0,0,0,.32),
    0 0 0 1px rgba(255,255,255,.08) inset;
  padding: 1.5rem 1.75rem 2rem;
  color: var(--text-dark);
}
.panel h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.5rem 0 .85rem;
  color: #0f2d5c;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.panel h2::before {
  content: "";
  width: 4px;
  height: 1.1em;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--wc-gold), var(--wc-blue));
}
.panel h2:first-of-type { margin-top: .5rem; }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: linear-gradient(135deg, #0e7490, #0284c7);
  color: #fff !important;
  padding: .5rem 1rem;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 700;
  margin-bottom: 1rem;
  box-shadow: 0 4px 14px rgba(14,116,144,.4);
  transition: transform .15s ease, filter .15s ease;
}
.btn-back:hover {
  text-decoration: none;
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.profile-line {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f2d5c;
  margin-bottom: 1.1rem;
  padding-bottom: .85rem;
  border-bottom: 2px solid #f1f5f9;
}
.profile-line .icon {
  font-size: 1.35rem;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0f2fe, #fef3c7);
}

/* Stats cards */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.stat-box {
  background: var(--stat-bg);
  border: 1px solid #bae6fd;
  border-radius: 14px;
  padding: .9rem .55rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(14,116,144,.08);
  transition: transform .15s ease;
}
.stat-box:hover { transform: translateY(-2px); }
.stat-box .label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.25;
  margin-bottom: .35rem;
  min-height: 2.2em;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.stat-box .value {
  font-size: 1.7rem;
  font-weight: 800;
  background: linear-gradient(180deg, #15803d, #16a34a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Tables */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f2d5c;
  margin: 1.25rem 0 .65rem;
  padding-left: .5rem;
  border-left: 4px solid var(--wc-gold);
}
.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(15,45,92,.06);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: .9rem;
}
.data-table thead tr {
  background: var(--table-head);
  color: #fff;
}
.data-table th {
  padding: .8rem .65rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.data-table th.col-match { text-align: left; }
.data-table td {
  padding: .72rem .65rem;
  border-bottom: 1px solid #f1f5f9;
  text-align: center;
  vertical-align: middle;
}
.data-table td.col-match {
  text-align: left;
  font-weight: 600;
  color: #1e3a5f;
}
.data-table tbody tr:nth-child(even) { background: #fafbfc; }
.data-table tbody tr:hover { background: #f0f9ff !important; }
.data-table tr.highlight {
  background: linear-gradient(90deg, #eff6ff, #fef9c3) !important;
}
.data-table tr.highlight td { font-weight: 700; }

.badge-pending {
  color: var(--pending);
  font-weight: 700;
  font-size: .85rem;
}
.badge-live {
  color: #dc2626;
  font-weight: 800;
  font-size: .85rem;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}
.calendar-day { margin-bottom: 1.75rem; }
.calendar-day-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f2d5c;
  margin: 0 0 .6rem;
  text-transform: capitalize;
  padding: .45rem .75rem;
  background: linear-gradient(90deg, #eff6ff, #fef9c3);
  border-radius: 8px;
  border-left: 4px solid var(--wc-gold);
}
.points-val {
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 1.05rem;
}
.points-zero { color: #94a3b8; font-weight: 600; }

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

/* Login */
.login-panel {
  max-width: 440px;
  margin: 0 auto;
  text-align: center;
}
.login-logo {
  width: 100px;
  height: 100px;
  margin: 0 auto 1rem;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.12));
}
.login-panel h2 {
  margin-bottom: .25rem;
  color: #0f2d5c;
  font-size: 1.35rem;
}
.login-panel .subtitle {
  color: var(--text-muted);
  margin-bottom: 1.35rem;
  font-size: .92rem;
}
label {
  display: block;
  margin: .7rem 0 .3rem;
  font-size: .88rem;
  font-weight: 600;
  color: #334155;
  text-align: left;
}
input, button, select {
  font: inherit;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  padding: .7rem .85rem;
}
input {
  width: 100%;
  background: #f8fafc;
  color: var(--text-dark);
  transition: border-color .15s, box-shadow .15s;
}
input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56,189,248,.25);
}
button, .btn-primary {
  background: linear-gradient(135deg, #0e7490, #0369a1);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 700;
  width: 100%;
  margin-top: 1.1rem;
  padding: .8rem;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(3,105,161,.35);
  transition: filter .15s, transform .15s;
}
button:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.alert {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: .75rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: .9rem;
  text-align: left;
}
.alert.success {
  background: #ecfdf5;
  color: #166534;
  border-color: #86efac;
}
.sync-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
}
.btn-sync {
  width: auto;
  margin-top: .5rem;
  padding: .55rem 1.1rem;
  font-size: .9rem;
}

/* Admin */
.inline-form {
  display: flex;
  gap: .35rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.inline-form input { width: 3.5rem; margin: 0; text-align: center; }
.inline-form button {
  width: auto;
  margin: 0;
  padding: .4rem .75rem;
  font-size: .82rem;
}
.form-grid {
  display: grid;
  gap: .5rem;
  max-width: 480px;
  margin-bottom: 1.5rem;
}
.form-grid button { width: auto; }

.admin-link {
  display: inline-block;
  background: linear-gradient(135deg, #eff6ff, #e0f2fe);
  color: var(--accent-dark) !important;
  padding: .35rem .75rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 700;
  border: 1px solid #93c5fd;
  transition: all .15s ease;
}
.admin-link:hover {
  background: #dbeafe;
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-back {
  display: inline-block;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--accent-dark);
}

.admin-quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.admin-quick-card {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: 1rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  color: var(--text-dark) !important;
  transition: transform .15s ease, box-shadow .15s ease;
}
.admin-quick-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}
.admin-quick-card .icon { font-size: 1.5rem; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 1rem 1rem 1.75rem;
  font-size: .78rem;
  color: rgba(226,232,240,.55);
  font-weight: 500;
}

@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-text { text-align: center; }
}
@media (max-width: 600px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 1rem; border-radius: 16px; }
  .site-hero h1 { font-size: 1.45rem; }
  .hero-logo { width: 100px; height: 100px; }
  .data-table { font-size: .82rem; }
  .top-nav a { font-size: .8rem; padding: .4rem .65rem; }
}
