/* My Alumni Manager: component styles. Colours come from the theme's variables when present. */
:root, .mam-admin {
	--_ink: var(--mam-ink, #16231F);
	--_muted: var(--mam-muted, #5A6B66);
	--_rule: var(--mam-rule, #C9D6DC);
	--_board: var(--mam-board, #24433A);
	--_pencil: var(--mam-pencil, #E2B13C);
	--_margin: var(--mam-danger, #B8433A);
	--_board-dark: var(--mam-board-dark, #1A332C);
	--_on-board: var(--mam-on-board, #ffffff);
	--_ok: var(--mam-ok, #2F6B4F);
}
.mam-card, .mam-member { background: #fff; border: 1px solid var(--_rule); border-radius: 6px; padding: 20px; margin: 0 0 20px; color: var(--_ink); }
.mam-card h2 { margin-top: 0; font-size: 1.25rem; }
.mam-lead { font-size: 1.15rem; margin: 0 0 20px; }
.mam-meta, .mam-hint { color: var(--_muted); font-size: .9rem; margin: 6px 0 0; }
.mam-links { margin-top: 20px; line-height: 1.9; }

/* Notices */
.mam-notice { padding: 12px 16px; border-radius: 6px; border: 1px solid var(--_rule); border-left-width: 5px; margin: 0 0 20px; background: #fff; }
.mam-notice--success { border-left-color: var(--_ok); }
.mam-notice--error { border-left-color: var(--_margin); }
.mam-notice--info { border-left-color: var(--_board); }

/* Forms */
.mam-field { margin: 0 0 16px; flex: 1 1 220px; }
.mam-field label, .mam-filter label { display: block; font-weight: 600; margin: 0 0 6px; }
.mam-form input[type=text], .mam-form input[type=email], .mam-form input[type=tel], .mam-form input[type=password], .mam-form select,
.mam-filter input, .mam-filter select {
	width: 100%; box-sizing: border-box; font: inherit; padding: 10px 12px; border: 1px solid #8DA0A8; border-radius: 4px; background: #fff; color: inherit; min-height: 44px;
}
.mam-form input:focus-visible, .mam-form select:focus-visible, .mam-filter input:focus-visible, .mam-filter select:focus-visible,
.mam-btn:focus-visible, .mam-tabs a:focus-visible { outline: 3px solid var(--_board); outline-offset: 2px; }
.mam-row { display: flex; flex-wrap: wrap; gap: 0 16px; }
.mam-check { margin: 0 0 18px; }
.mam-check label { font-weight: 400; display: flex; gap: 10px; align-items: flex-start; }
.mam-check input { margin-top: 5px; width: 18px; height: 18px; }
.mam-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Buttons */
.mam-btn { display: inline-block; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; padding: 10px 18px; min-height: 44px; box-sizing: border-box; border-radius: 4px; border: 1px solid var(--_board); background: #fff; color: var(--_board); }
.mam-btn:hover { background: #EEF3F0; }
.mam-btn--primary { background: var(--_board); color: var(--_on-board); }
.mam-btn--primary:hover { background: var(--_board-dark); color: var(--_on-board); }
.mam-btn--danger { border-color: var(--_margin); color: var(--_margin); }
.mam-btn--danger:hover { background: #FBEDEB; }
.mam-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Committee area */
.mam-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.mam-tabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 1px solid var(--_rule); border-radius: 999px; background: #fff; text-decoration: none; font-weight: 600; color: var(--_ink); }
.mam-tabs a:hover { border-color: var(--_board); }
.mam-tabs a[aria-current=page] { background: var(--_board); border-color: var(--_board); color: var(--_on-board); box-shadow: 0 3px 0 var(--_pencil); }
.mam-count { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 1em; background: var(--_pencil); color: var(--mam-on-secondary, #16231F); font-size: .8rem; text-align: center; }
.mam-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 0 0 8px; }
.mam-filter label { flex: 1 1 160px; }
.mam-member__head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin: 0 0 8px; }
.mam-member__head h3 { margin: 0; font-size: 1.15rem; }
.mam-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 16px; margin: 0 0 16px; }
.mam-facts dt { font-size: .85rem; color: var(--_muted); }
.mam-facts dd { margin: 0; overflow-wrap: anywhere; }
.mam-chip { display: inline-block; padding: 2px 10px; border-radius: 1em; font-size: .85rem; font-weight: 600; border: 1px solid var(--_rule); }
.mam-chip--pending { background: #FFF6DC; border-color: var(--_pencil); }
.mam-chip--approved { background: #E4F2EA; border-color: var(--_ok); color: #1F4F3A; }
.mam-chip--rejected { background: #FBEDEB; border-color: var(--_margin); color: #7C2A24; }
.mam-pager { display: flex; gap: 16px; align-items: center; margin: 20px 0; }
.mam-table-wrap { overflow-x: auto; border: 1px solid var(--_rule); border-radius: 6px; background: #fff; }
.mam-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.mam-table th, .mam-table td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--_rule); }
.mam-table th { background: #EEF3F0; white-space: nowrap; }

/* Election */
.mam-chip--draft, .mam-chip--closed, .mam-chip--nominations-closed, .mam-chip--rejected-pay { background: #EEF3F0; }
.mam-chip--nominations, .mam-chip--voting, .mam-chip--confirmed, .mam-chip--pay-success { background: #E4F2EA; border-color: var(--_ok); color: #1F4F3A; }
.mam-chip--pending-payment, .mam-chip--awaiting-confirmation, .mam-chip--pay-pending, .mam-chip--pay-awaiting_confirmation { background: #FFF6DC; border-color: var(--_pencil); }
.mam-chip--withdrawn, .mam-chip--late-paid, .mam-chip--rejected, .mam-chip--pay-failed, .mam-chip--pay-rejected { background: #FBEDEB; border-color: var(--_margin); color: #7C2A24; }
.mam-form textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 10px 12px; border: 1px solid #8DA0A8; border-radius: 4px; background: #fff; color: inherit; }
.mam-options { border: 0; padding: 0; margin: 0 0 16px; }
.mam-options legend { font-weight: 600; padding: 0; margin: 0 0 8px; }
.mam-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 0 0 8px; border: 1px solid var(--_rule); border-radius: 4px; background: #fff; cursor: pointer; }
.mam-option input { margin-top: 5px; width: 18px; height: 18px; flex: none; }
.mam-bank { border-left: 4px solid var(--_pencil); background: #FFFDF5; padding: 12px 16px; margin: 12px 0; }
.mam-bank h4 { margin: 0 0 8px; }
.mam-candidate { padding: 10px 0; border-top: 1px solid var(--_rule); }
.mam-candidate:first-of-type { border-top: 0; }
.mam-candidate summary { cursor: pointer; color: var(--_muted); }
.mam-pay { border-top: 1px solid var(--_rule); padding: 10px 0; margin-top: 10px; }
.mam-member details { margin: 8px 0; }

/* Voting */
.mam-chip--voting-closed { background: #EEF3F0; }
.mam-chip--runoff { background: #FFF6DC; border-color: var(--_pencil); }
.mam-subtabs { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 14px; }
.mam-subtabs a { text-decoration: none; font-weight: 600; padding: 6px 0; color: var(--_muted); border-bottom: 2px solid transparent; }
.mam-subtabs a[aria-current=page] { color: var(--_ink); border-bottom-color: var(--_pencil); }
.mam-winner { font-family: Bitter, Georgia, serif; font-size: 1.35rem; font-weight: 700; margin: 4px 0 12px; }
.mam-counts { margin: 10px 0 0; }
.mam-bar { display: grid; grid-template-columns: minmax(90px, 30%) 1fr 2.5em; gap: 10px; align-items: center; margin: 6px 0; }
.mam-bar__label { overflow-wrap: anywhere; }
.mam-bar__track { display: block; height: 14px; background: #E7ECEA; border-radius: 3px; overflow: hidden; }
.mam-bar__fill { display: block; height: 100%; background: #8DA0A8; }
.mam-bar--lead .mam-bar__fill { background: var(--_board); }
.mam-bar--lead .mam-bar__label { font-weight: 700; }
.mam-bar__n { text-align: right; font-variant-numeric: tabular-nums; }
.mam-form--inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.mam-form--inline .mam-field { margin: 0; flex: 0 1 200px; }
.mam-form input[type=number] { width: 100%; box-sizing: border-box; font: inherit; padding: 10px 12px; border: 1px solid #8DA0A8; border-radius: 4px; min-height: 44px; }

/* Password show/hide */
.mam-pw { position: relative; display: block; max-width: 100%; }
.mam-pw input { padding-right: 52px !important; }
.mam-pw__toggle { position: absolute; top: 0; right: 0; bottom: 0; width: 48px; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; color: #5A6B66; cursor: pointer; border-radius: 0 4px 4px 0; padding: 0; }
.mam-pw__toggle:hover { color: #16231F; }
.mam-pw__toggle:focus-visible { outline: 3px solid var(--_board); outline-offset: -3px; }
.mam-pw__toggle[aria-pressed=true] { color: #24433A; }
.mam-admin .mam-pw { display: inline-block; vertical-align: middle; }

.mam-total { font-weight: 600; margin: 0 0 14px; min-height: 1.4em; }

/* Roles */
.mam-chip--role { background: #E6EEF7; border-color: #8DA0A8; color: #1F3A52; margin-left: 6px; }
.mam-roleform { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--_rule); }
.mam-list { margin: 0; padding-left: 1.1em; }
.mam-list li { margin: 4px 0; }

/* wp-admin pages */
.mam-admin .mam-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 16px 0; }
.mam-admin .mam-card { max-width: none; }
.mam-admin .mam-card h2 { font-size: 1.15rem; }
.mam-admin .mam-member, .mam-admin .mam-card, .mam-admin .mam-notice { max-width: 980px; }
.mam-admin .mam-grid .mam-card { margin: 0; }
.mam-admin .mam-filter { margin-top: 12px; }
.mam-admin .mam-table-wrap { max-width: 100%; }
.mam-admin .mam-btn { font-size: 14px; }

/* ---------- Small screens: nothing may push the page wider than the phone ---------- */
.mam-card, .mam-member, .mam-notice, .mam-filter, .mam-form, .mam-field, .mam-row > *, .mam-facts > div, .mam-bank { min-width: 0; }
.mam-form input, .mam-form select, .mam-form textarea, .mam-filter input, .mam-filter select { max-width: 100%; }
.mam-facts { grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); }
.mam-admin .mam-grid { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.mam-table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mam-member__head, .mam-actions, .mam-pager, .mam-subtabs { flex-wrap: wrap; }
.mam-admin input.regular-text, .mam-admin .large-text, .mam-admin select, .mam-admin textarea { max-width: 100%; }
.mam-admin .mam-card, .mam-admin .mam-member { overflow-wrap: anywhere; }
@media (max-width: 480px) {
	.mam-card, .mam-member { padding: 16px; }
	.mam-bar { grid-template-columns: minmax(70px, 34%) 1fr 2em; gap: 8px; }
	.mam-actions .mam-btn, .mam-pager .mam-btn { flex: 1 1 auto; text-align: center; }
	.mam-tabs a { padding: 0 14px; }
}

/* ---------- Members: avatars, compact cards, list switcher, details ---------- */
.mam-avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; overflow: hidden; background: var(--_board); color: var(--_on-board); font-weight: 700; line-height: 1; vertical-align: middle; }
.mam-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mam-listbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.mam-listbar .mam-meta { margin: 0; }
.mam-switch { display: inline-flex; border: 1px solid var(--_board); border-radius: 999px; overflow: hidden; }
.mam-switch a { padding: 6px 18px; min-height: 36px; display: inline-flex; align-items: center; text-decoration: none; font-weight: 600; color: var(--_board); background: #fff; }
.mam-switch a[aria-current=true] { background: var(--_board); color: var(--_on-board); }
.mam-mcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 10px; margin: 0 0 20px; }
.mam-mcard { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #fff; border: 1px solid var(--_rule); border-radius: 8px; color: var(--_ink); text-decoration: none; min-width: 0; }
.mam-mcard:hover { border-color: var(--_board); box-shadow: 0 2px 0 var(--_pencil); }
.mam-mcard:focus-visible { outline: 3px solid var(--_board); outline-offset: 2px; }
.mam-mcard__main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.mam-mcard__main strong { overflow-wrap: anywhere; line-height: 1.25; }
.mam-mcard__meta { font-size: .85rem; color: var(--_muted); }
.mam-mcard__chips { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.mam-mcard__chips .mam-chip { font-size: .75rem; padding: 1px 8px; white-space: nowrap; }
.mam-namecell { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; color: var(--_ink); }
.mam-namecell:hover { text-decoration: underline; }
.mam-members-table td { vertical-align: middle; white-space: nowrap; }
.mam-profilehead { display: flex; gap: 16px; align-items: center; }
.mam-profilehead h2 { margin: 0 0 4px; }
.mam-profilehead > div { min-width: 0; flex: 1 1 auto; }
.mam-label { display: block; font-weight: 600; margin: 0 0 6px; }
.mam-money { margin: 0 0 8px; }
.mam-void td { color: var(--_muted); text-decoration: line-through; }
.mam-void td:last-child { text-decoration: none; }
.mam-chip--dues-none { background: #F3F5F1; }
.mam-chip--dues-partial { background: #FFF6DC; border-color: var(--_pencil); }
.mam-chip--dues-paid { background: #E4F2EA; border-color: var(--_ok); color: #1F4F3A; }
@media (max-width: 480px) {
	.mam-profilehead { align-items: flex-start; }
	.mam-mcard__chips { max-width: 42%; }
}

/* Polish: keep the percentage on one line, and stop the theme's heading margin opening a gap inside cards */
.mam-bar { grid-template-columns: minmax(70px, 30%) 1fr 3.4em; }
.mam-bar__n { white-space: nowrap; }
.entry-content .mam-card > :first-child,
.entry-content .mam-card h2,
.entry-content .mam-card h3,
.entry-content .mam-member h3 { margin-top: 0; }
.entry-content .mam-member__head h2, .entry-content .mam-member__head h3 { margin-top: 0; margin-bottom: 0; }
@media (max-width: 480px) { .mam-bar { grid-template-columns: minmax(60px, 28%) 1fr 3.2em; } }
