:root {
  --navy: #0b2545;
  --navy-2: #13315c;
  --teal: #1ec8a5;
  --teal-600: #16a085;
  --accent: #ffb703;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --ink: #14213d;
  --muted: #64748b;
  --line: #e5eaf1;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --ok: #0f9d58;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 37, 69, 0.08);
  --shadow-sm: 0 2px 8px rgba(11, 37, 69, 0.06);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.main { flex: 1; padding-top: 32px; padding-bottom: 56px; }

h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
h2 { font-size: 1.2rem; font-weight: 700; margin: 0; }
h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; }
p { margin: 0 0 10px; }
a { color: var(--teal-600); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.inline { display: inline; margin: 0; }

/* Header / nav */
.site-header {
  background: var(--navy);
  background: linear-gradient(120deg, var(--navy), var(--navy-2));
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--teal); color: var(--navy); font-size: 1.1rem;
}
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { color: rgba(255,255,255,0.82); font-weight: 500; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-links a.active { color: #fff; }
.nav-user { color: rgba(255,255,255,0.6); font-size: 0.9rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 11px 18px; font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: transform .05s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 13px; font-size: 0.85rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--teal); color: #06251d; }
.btn-primary:hover { background: var(--teal-600); color: #fff; }
.btn-outline { background: transparent; border-color: rgba(255,255,255,0.5); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,0.1); }
.main .btn-outline { border-color: var(--line); color: var(--ink); }
.main .btn-outline:hover { background: #eef2f7; }
.btn-ghost { background: transparent; color: inherit; border-color: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,0.12); }
.main .btn-ghost:hover { background: #eef2f7; }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 24px; align-items: center;
  background: linear-gradient(120deg, var(--navy), var(--navy-2));
  color: #fff; border-radius: 20px; padding: 48px; overflow: hidden;
  box-shadow: var(--shadow); margin-bottom: 40px;
}
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.72rem; font-weight: 700; color: var(--teal);
  background: rgba(30,200,165,0.14); padding: 5px 10px; border-radius: 999px; margin-bottom: 14px;
}
.hero h1 { font-size: 2.4rem; line-height: 1.1; }
.hero .lead { color: rgba(255,255,255,0.82); font-size: 1.05rem; max-width: 44ch; }
.hero-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.hero-panel { position: relative; height: 220px; }
.grid-glow {
  position: absolute; inset: 0; border-radius: 16px;
  background-image:
    radial-gradient(circle at 30% 30%, rgba(30,200,165,0.5), transparent 55%),
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 100% 100%, 26px 26px, 26px 26px;
  border: 1px solid rgba(255,255,255,0.12);
}

/* Features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.feature-icon { font-size: 1.6rem; margin-bottom: 8px; }
.feature-card p { color: var(--muted); margin: 0; }

/* Page head */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }

/* Panels & cards */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cards-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.link { font-size: 0.9rem; font-weight: 600; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: none; }
.list-title { font-weight: 600; color: var(--ink); }

.thumb-row { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb { width: 84px; height: 84px; border-radius: 10px; background-size: cover; background-position: center; background-color: #dfe6ef; border: 1px solid var(--line); }

/* Auth cards */
.auth-wrap { display: flex; justify-content: center; padding: 20px 0; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow);
}
.auth-card.wide { max-width: 560px; }
.auth-card.center { text-align: center; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.form label, .upload-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input, textarea, select {
  font: inherit; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(30,200,165,0.18); }
textarea { resize: vertical; }

/* Alerts & badges */
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 0.92rem; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.alert-info { background: #eef7ff; color: #1a5f9e; border: 1px solid #cfe6fb; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: #eef2f7; color: var(--muted); }
.badge-ok { background: rgba(15,157,88,0.12); color: var(--ok); }
.badge-full { background: #fff3cd; color: #8a6d00; }

/* Events */
.event-list { display: flex; flex-direction: column; gap: 16px; }
.event-card {
  display: flex; gap: 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.event-card.is-past { opacity: 0.68; }
.event-date {
  flex: 0 0 64px; height: 64px; border-radius: 12px; background: var(--navy); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.event-date .mon { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--teal); }
.event-date .day { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.event-body { flex: 1; }
.event-body p { color: var(--muted); margin: 8px 0; }
.event-meta { margin-bottom: 10px; }
.event-actions { display: flex; align-items: center; gap: 10px; }
.reg-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.reg-form input[type=text] { max-width: 240px; }
.guests { max-width: 90px; }
.guests input { width: 80px; }

/* Gallery */
.upload-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.upload-form input[type=text] { max-width: 200px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.gallery-item { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.gallery-img { height: 160px; background-size: cover; background-position: center; background-color: #dfe6ef; }
.gallery-item figcaption { padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }

/* Buttons: danger */
.btn-danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-danger:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
select:disabled { opacity: 0.55; }

/* Admin layout */
.admin-shell { display: grid; grid-template-columns: 210px 1fr; gap: 24px; align-items: start; }
.admin-side {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-sm); position: sticky; top: 84px;
}
.admin-side-title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
.admin-side nav { display: flex; flex-direction: column; gap: 2px; }
.admin-side nav a { padding: 9px 12px; border-radius: 9px; color: var(--ink); font-weight: 500; font-size: 0.95rem; }
.admin-side nav a:hover { background: #eef2f7; text-decoration: none; }
.admin-side nav a.active { background: var(--navy); color: #fff; }
.admin-side-back { display: block; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.85rem; }
.admin-main { min-width: 0; }
.admin-main h1 { margin-bottom: 18px; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 4px;
}
.stat-num { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; color: var(--navy); }
.stat-label { font-size: 0.85rem; color: var(--muted); }
.stat-warn { border-color: #ffe08a; background: #fffdf5; }
.stat-warn .stat-num { color: #a86b00; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.badge-you { background: rgba(30,200,165,0.14); color: var(--teal-600); margin-left: 6px; }
.table select { padding: 6px 8px; font-size: 0.85rem; }

@media (max-width: 820px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; }
  .admin-side nav { flex-direction: row; flex-wrap: wrap; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* Choice fieldset (radio group) */
.choice { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.choice legend { font-weight: 600; font-size: 0.9rem; padding: 0 6px; }
.choice .radio { display: block; font-weight: 400; margin: 8px 0; cursor: pointer; }
.choice .radio input { width: auto; margin-right: 8px; }

/* Member detail grid */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }

/* Copyable link box */
.link-box { display: flex; gap: 8px; margin: 12px 0; }
.link-box input { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.85rem; background: #f6f8fb; }

/* Footer */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.75); padding: 22px 0; margin-top: auto; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.9rem; }
.footer-inner a { color: var(--teal); }
.footer-meta { display: flex; gap: 8px; align-items: center; }

/* Responsive */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding: 32px; }
  .hero-panel { display: none; }
  .features, .cards-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .nav-links { gap: 12px; }
  .nav-user { display: none; }
}
