/* ============================================================
   main.css  —  Social Club Website  (Light Theme)
   ============================================================ */

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

:root {
  --bg:       #f4f6f9;
  --surface:  #ffffff;
  --surface2: #f0f2f5;
  --border:   rgba(0,0,0,0.09);
  --border2:  rgba(0,0,0,0.18);
  --accent:   #1a5276;
  --accent-h: #21618c;
  --text:     #1a1a2e;
  --muted:    #6c757d;
  --danger:   #c0392b;
  --success:  #1e8449;
  --warning:  #b7770d;
  --serif:    'DM Serif Display', Georgia, serif;
  --sans:     'DM Sans', sans-serif;
  --radius:   10px;
  --radius-lg:14px;
}

html, body {
  min-height: 100%;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 2rem;
  height: 65px;
  background: var(--surface);
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo img {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--accent);
  line-height: 1.2;
}

.main-nav { display: flex; gap: 0.25rem; flex: 1; }
.main-nav a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 5px 11px;
  border-radius: 7px;
  transition: color .15s, background .15s;
  font-weight: 400;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--accent);
  background: rgba(26,82,118,.07);
}

.header-user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.header-user a { color: var(--muted); text-decoration: none; transition: color .15s; }
.header-user a:hover { color: var(--accent); }

.role-badge {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 100px;
  font-weight: 500;
  letter-spacing: .04em;
}
.role-superadmin { background: rgba(26,82,118,.12); color: var(--accent); }
.role-admin       { background: rgba(26,82,118,.08); color: var(--accent-h); }
.role-treasurer   { background: rgba(30,132,73,.12); color: #1e8449; }
.role-secretary   { background: rgba(142,68,173,.12); color: #8e44ad; }
.role-member      { background: rgba(108,117,125,.12); color: var(--muted); }

/* ── Main ─────────────────────────────────────────────────── */
.site-main { max-width: 1100px; margin: 0 auto; padding: 2rem; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  background: var(--surface);
}

/* ── Page title ───────────────────────────────────────────── */
.page-title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 1.5rem;
  color: var(--text);
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* ── Stat grid ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.stat-card .label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.stat-card .value { font-size: 28px; font-family: var(--serif); font-weight: 400; color: var(--text); }
.val-green  { color: var(--success); }
.val-amber  { color: var(--warning); }
.val-red    { color: var(--danger); }
.val-accent { color: var(--accent); }

/* ── Toolbar ──────────────────────────────────────────────── */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.25rem;
}

/* ── Forms ────────────────────────────────────────────────── */
input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,82,118,.1);
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 100px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid.triple { grid-template-columns: 1fr 1fr 1fr; }
.form-group { margin-bottom: .9rem; }
.form-group.span2 { grid-column: span 2; }
.form-group label {
  display: block;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 500;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: background .2s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #ffffff; }
.btn-primary:hover { background: var(--accent-h); }
.btn-ghost { background: none; border: 1px solid var(--border2); color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--text); }
.btn-danger { background: rgba(192,57,43,.1); color: var(--danger); border: 1px solid rgba(192,57,43,.2); }
.btn-danger:hover { background: rgba(192,57,43,.2); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 5px 7px; border-radius: 7px; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; transition: background .15s, color .15s; }
.btn-icon:hover { background: var(--surface2); color: var(--text); }
.btn-icon.danger:hover { color: var(--danger); }

/* ── Table ────────────────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: auto;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f0f4f8; }
td { padding: 11px 16px; vertical-align: middle; color: var(--text); }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 100px;
  letter-spacing: .04em;
}
.badge-active    { background: #d5f5e3; color: #1e8449; }
.badge-inactive  { background: #f0f0f0; color: #6c757d; }
.badge-suspended { background: #fadbd8; color: #c0392b; }
.badge-upcoming  { background: #d6eaf8; color: #1a5276; }
.badge-past      { background: #f0f0f0; color: #6c757d; }
.badge-sent      { background: #d5f5e3; color: #1e8449; }
.badge-draft     { background: #fef9e7; color: #b7770d; }
.badge-failed    { background: #fadbd8; color: #c0392b; }

/* ── Avatar ───────────────────────────────────────────────── */
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
  margin-right: 10px;
}

/* ── Flash messages ───────────────────────────────────────── */
.flash {
  padding: 12px 18px;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 14px;
}
.flash-success { background: #d5f5e3; border: 1px solid #a9dfbf; color: #1e8449; }
.flash-error   { background: #fadbd8; border: 1px solid #f1948a; color: #c0392b; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; margin-top: 1.25rem; justify-content: center; }
.pagination a, .pagination span {
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 13px;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface);
}
.pagination a:hover { color: var(--accent); border-color: var(--accent); }
.pagination .current { background: var(--accent); color: #ffffff; border-color: var(--accent); font-weight: 500; }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem; color: var(--muted); font-size: 14px; }

/* ── Login page ───────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--bg);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
}
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 12px;
}
.login-logo img {
  height: 80px;
  width: auto;
  object-fit: contain;
}
.login-crest {
  width: 56px; height: 56px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--accent);
  background: rgba(26,82,118,.06);
}
.login-title { font-family: var(--serif); font-size: 26px; text-align: center; color: var(--text); margin-bottom: 4px; }
.login-sub { text-align: center; font-size: 12px; color: var(--muted); letter-spacing: .07em; text-transform: uppercase; margin-bottom: 2rem; }
.login-hint { margin-top: 1.25rem; font-size: 12px; color: var(--muted); text-align: center; border-top: 1px solid var(--border); padding-top: 1rem; }

/* ── Hamburger button ─────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
  border-radius: 8px;
  transition: background .15s;
}
.hamburger:hover { background: var(--surface2); }
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav drawer ────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  z-index: 49;
  padding: 1rem;
  border-top: 1px solid var(--border);
  overflow-y: auto;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  padding: 14px 16px;
  border-radius: 10px;
  font-weight: 400;
  transition: background .15s, color .15s;
  border-bottom: 1px solid var(--border);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover { background: var(--surface2); color: var(--accent); }
.mobile-nav .nav-role {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 8px 16px 4px;
}

/* ── Full mobile responsive ───────────────────────────────── */
@media (max-width: 768px) {
  .site-header { padding: 0 1rem; gap: .75rem; height: 60px; }
  .main-nav { display: none !important; }
  .header-user { display: none !important; }
  .hamburger { display: flex !important; }
  .logo-text { font-size: 15px; }
  .logo img { height: 34px; }

  .site-main { padding: 1rem; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: .75rem 1rem; }
  .stat-card .value { font-size: 22px; }

  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }

  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 480px; }
  td, th { padding: 8px 10px; font-size: 13px; }

  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar input, .toolbar select { width: 100%; }

  .page-title { font-size: 22px; margin-bottom: 1rem; }
  .card { padding: 1rem; }

  .login-card { padding: 1.75rem 1.25rem; }
  .login-logo img { height: 60px; }
  .login-title { font-size: 22px; }

  .btn { justify-content: center; }
}
