/* Supplemental styles for the member/admin system — layers on top of
   /css/style.css, reusing the same design tokens (colors, radius, shadows,
   fonts) so this never reads as a bolted-on, separate application. */

.ma-flash {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 16px;
}
.ma-flash-success { background: var(--forest-50); color: var(--forest-800); border: 1.5px solid var(--forest-100); }
.ma-flash-error { background: var(--terracotta-100); color: var(--terracotta-600); border: 1.5px solid var(--terracotta-400); }
.ma-flash-info { background: var(--gold-100); color: var(--gold-600); border: 1.5px solid var(--gold-400); }

.ma-shell { padding: 48px 0 80px; }
.ma-narrow { max-width: 560px; margin: 0 auto; }
.ma-wide { max-width: 960px; margin: 0 auto; }

/* New-member vs existing-member entry toggle, shown at the top of both
   register.php and login.php so it's never ambiguous which one you're on
   or how to reach the other. */
.ma-auth-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 24px;
}
.ma-auth-toggle a {
  display: block; text-align: center;
  padding: 14px 16px; border-radius: var(--radius-md);
  border: 1.5px solid var(--forest-100);
  font-weight: 700; font-size: 0.92rem;
  transition: all 0.2s ease;
}
.ma-auth-toggle a small { display: block; font-weight: 400; font-size: 0.78rem; color: var(--ink-500); margin-top: 3px; }
.ma-auth-toggle a.current { background: var(--forest-700); border-color: var(--forest-700); color: var(--white); }
.ma-auth-toggle a.current small { color: rgba(255,255,255,0.75); }
.ma-auth-toggle a:not(.current):hover { border-color: var(--forest-500); background: var(--forest-50); }

.ma-steps {
  display: flex; justify-content: center; gap: 8px; margin-bottom: 32px; flex-wrap: wrap;
}
.ma-step {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--radius-pill);
  background: var(--forest-100); color: var(--forest-600);
  font-size: 0.82rem; font-weight: 700;
}
.ma-step.active { background: var(--forest-700); color: var(--white); }
.ma-step.done { background: var(--forest-800); color: var(--white); }

.ma-status-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: var(--radius-pill);
  font-weight: 700; font-size: 0.88rem;
}
.ma-status-pending_verification, .ma-status-draft, .ma-status-pending { background: var(--gold-100); color: var(--gold-600); }
.ma-status-approved, .ma-status-active { background: var(--forest-100); color: var(--forest-700); }
.ma-status-rejected, .ma-status-deactivated { background: var(--terracotta-100); color: var(--terracotta-600); }

.ma-stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; margin-bottom: 40px; }
.ma-stat-card {
  background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  border: 1px solid rgba(20,30,15,0.05); padding: 22px 18px; text-align: center;
}
.ma-stat-card .num { font-family: var(--font-head); font-size: 1.9rem; font-weight: 700; color: var(--forest-800); }
.ma-stat-card .label { font-size: 0.8rem; color: var(--ink-500); margin-top: 4px; }

.ma-table-wrap { overflow-x: auto; background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid rgba(20,30,15,0.05); }
.ma-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 760px; }
.ma-table th { text-align: left; padding: 14px 16px; background: var(--forest-50); color: var(--forest-800); font-weight: 700; white-space: nowrap; }
.ma-table td { padding: 14px 16px; border-top: 1px solid var(--forest-100); vertical-align: middle; }
.ma-table tr:hover td { background: var(--forest-50); }

.ma-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; align-items: center; }
.ma-filters input, .ma-filters select { padding: 10px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--forest-100); font-size: 0.88rem; font-family: inherit; background: var(--cream-50); }
.ma-filter-search { flex: 1 1 240px; min-width: 0; }

.ma-id-card {
  width: 380px; max-width: 100%; margin: 0 auto;
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg);
  background: var(--white); border: 1px solid rgba(20,30,15,0.08);
  font-family: var(--font-body);
}
.ma-id-card-head {
  background: linear-gradient(135deg, var(--forest-800), var(--forest-600));
  color: var(--white); padding: 20px 22px; display: flex; align-items: center; gap: 12px;
}
.ma-id-card-head img { width: 40px; height: 40px; border-radius: 50%; background: var(--white); }
.ma-id-card-head strong { display: block; font-family: var(--font-head); font-size: 1rem; line-height: 1.2; }
.ma-id-card-head span { font-size: 0.68rem; opacity: 0.85; letter-spacing: 0.04em; text-transform: uppercase; }
.ma-id-card-body { padding: 24px 22px; display: flex; gap: 18px; align-items: flex-start; }
.ma-id-card-avatar {
  flex-shrink: 0; width: 78px; height: 78px; border-radius: 50%;
  background: var(--forest-100); color: var(--forest-700);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 1.6rem; font-weight: 700;
  border: 3px solid var(--gold-400);
}
.ma-id-card-body h3 { margin: 0 0 2px; font-size: 1.15rem; }
.ma-id-card-code { color: var(--forest-700); font-weight: 800; font-size: 0.92rem; margin-bottom: 10px; letter-spacing: 0.02em; }
.ma-id-card-meta { display: grid; gap: 3px; font-size: 0.8rem; color: var(--ink-500); }
.ma-id-card-meta b { color: var(--ink-900); }
.ma-id-card-foot {
  padding: 16px 22px; background: var(--forest-50); border-top: 1px dashed var(--forest-100);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.ma-id-card-foot .qr { background: var(--white); padding: 4px; border-radius: 6px; }
.ma-id-card-foot small { display: block; color: var(--ink-300); font-size: 0.66rem; max-width: 180px; }

@media (max-width: 1080px) {
  .ma-stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .ma-shell { padding: 28px 0 56px; }
  .ma-stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 28px; }
  .ma-stat-card { padding: 16px 10px; }
  .ma-stat-card .num { font-size: 1.5rem; }
  .ma-stat-card .label { font-size: 0.72rem; }
  .ma-id-card-body { flex-direction: column; align-items: center; text-align: center; }
  .ma-id-card-foot { flex-direction: column; }

  /* Filter bar: each control full-width and stacked, not a cramped row.
     flex-basis in a row container sizes width — but once the container
     becomes flex-direction:column, that same basis sizes height instead,
     which is what made the search box balloon to 240px tall. Cancel it. */
  .ma-filters { flex-direction: column; align-items: stretch; gap: 8px; }
  .ma-filters input, .ma-filters select, .ma-filters button, .ma-filters a { width: 100%; text-align: center; box-sizing: border-box; }
  .ma-filter-search { flex: none; }

  /* The wide admin tables (Applications, Members, Recent Applications) turn
     into a stack of labeled cards instead of a horizontally-scrolling table
     that reads as "unstructured" on a phone. */
  .ma-table-wrap { overflow-x: visible; border: none; box-shadow: none; background: none; }
  .ma-table { min-width: 0; width: 100%; }
  .ma-table thead { display: none; }
  .ma-table, .ma-table tbody, .ma-table tr, .ma-table td { display: block; width: 100%; }
  .ma-table tr {
    background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
    border: 1px solid rgba(20,30,15,0.05); margin-bottom: 14px; padding: 6px 16px; overflow: hidden;
  }
  .ma-table td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 10px 0; border-top: 1px solid var(--forest-50); text-align: right;
  }
  .ma-table td:first-child { border-top: none; }
  .ma-table td[data-label]::before {
    content: attr(data-label); font-weight: 700; color: var(--forest-800);
    font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; text-align: left; flex-shrink: 0;
  }
  .ma-table td[data-label=""]::before { display: none; }
  .ma-table td[data-label=""] { justify-content: flex-end; }
  /* The "no results" row has no data-label / colspan styling — keep it centered. */
  .ma-table td[colspan] { display: block; text-align: center; }
  .ma-table td[colspan]::before { content: none; }
}

@media (max-width: 420px) {
  .ma-stat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  /* Approve / Reject side-by-side becomes a clear top-to-bottom stack. */
  .ma-action-row { flex-direction: column; }
  .ma-action-row > form { flex: none; width: 100%; }

  /* bank-table (registration details, payment details) already wraps long
     values, but give it a bit more breathing room at phone width. */
  .bank-table td.value { flex-wrap: wrap; }
}
