/* ============================================================
   PCEA Gold Sheet — shared styles
   ============================================================ */
:root {
  --gold:        #b8892b;
  --gold-soft:   #cfa14a;
  --gold-tint:   #f6efdf;
  --ink:         #1c2434;
  --ink-soft:    #46536b;
  --muted:       #6b7688;
  --line:        #e4e2da;
  --bg:          #f7f5ef;
  --card:        #ffffff;
  --danger:      #b23b3b;
  --danger-bg:   #fbeaea;
  --ok:          #2f7d4f;
  --shadow:      0 1px 2px rgba(28, 36, 52, .06), 0 8px 24px rgba(28, 36, 52, .06);
  --radius:      14px;
  --serif:       "Fraunces", Georgia, "Times New Roman", serif;
  --sans:        "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(160deg, #202a3d 0%, #2b3752 100%);
  color: #fff;
  text-align: center;
  padding: 2.4rem 1.25rem 2rem;
  border-bottom: 4px solid var(--gold);
}
.site-header .kicker {
  letter-spacing: .28em;
  text-transform: uppercase;
  font-size: .72rem;
  color: var(--gold-soft);
  font-weight: 600;
  margin: 0 0 .55rem;
}
.site-header h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 5vw, 2.7rem);
  line-height: 1.1;
  margin: 0;
}
.site-header .subtitle {
  margin: .5rem 0 0;
  color: #c8d0df;
  font-size: clamp(.9rem, 2.5vw, 1.05rem);
  font-style: italic;
  font-family: var(--serif);
}

/* ---------- Primary nav ---------- */
.main-nav {
  display: flex; gap: .4rem; justify-content: center;
  margin-top: 1.15rem; flex-wrap: wrap;
}
.nav-link {
  color: #cdd5e2; font-weight: 600; font-size: .92rem;
  padding: .5rem 1.05rem; border-radius: 999px;
  letter-spacing: .01em; transition: background .15s, color .15s;
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .1); text-decoration: none; }
.nav-link.active,
.nav-link.active:hover {
  color: #222c40; background: var(--gold-soft); text-decoration: none;
}

/* ---------- Layout ---------- */
.container { max-width: 860px; margin: 0 auto; padding: 0 1.1rem; }
.main { padding: 1.5rem 0 4rem; }

/* ---------- Search / toolbar ---------- */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 245, 239, .92);
  backdrop-filter: blur(8px);
  padding: .9rem 0 .8rem;
  border-bottom: 1px solid var(--line);
}
.search-wrap { position: relative; }
.search-wrap .icon {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
#search {
  width: 100%;
  padding: .85rem 2.6rem .85rem 2.8rem;
  font-size: 1rem;
  font-family: var(--sans);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
#search:focus {
  outline: none;
  border-color: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(184, 137, 43, .18);
}
.clear-btn {
  position: absolute; right: .55rem; top: 50%; transform: translateY(-50%);
  border: none; background: var(--line); color: var(--ink-soft);
  width: 1.7rem; height: 1.7rem; border-radius: 50%; cursor: pointer;
  font-size: 1rem; line-height: 1; display: none;
}
.clear-btn:hover { background: #d8d6cd; }

.toolbar-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-top: .7rem; flex-wrap: wrap;
}
.count { color: var(--muted); font-size: .85rem; }
.link-btn {
  background: none; border: none; color: var(--gold);
  font: inherit; font-size: .85rem; cursor: pointer; padding: .2rem .1rem;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- Member accordion ---------- */
.registry { margin-top: 1.1rem; display: flex; flex-direction: column; gap: .7rem; }

.member {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color .15s;
}
.member.open { border-color: var(--gold-soft); }

.member-head {
  display: flex; align-items: center; gap: .9rem;
  width: 100%; text-align: left;
  padding: 1rem 1.1rem;
  background: none; border: none; cursor: pointer;
  font: inherit; color: inherit;
}
.member-head:hover { background: #fcfbf7; }

.cat-label {
  display: block;
  font-size: .7rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .18rem;
}
.head-text { flex: 1 1 auto; min-width: 0; }
.head-text .company {
  font-family: var(--serif);
  font-weight: 600; font-size: 1.08rem; color: var(--ink);
  display: block; line-height: 1.25;
}
.head-text .head-rep {
  color: var(--muted); font-size: .85rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chevron {
  flex: none; color: var(--muted);
  transition: transform .2s ease;
}
.member.open .chevron { transform: rotate(180deg); }

.member-body {
  display: none;
  padding: 0 1.1rem 1.15rem;
  border-top: 1px solid var(--line);
}
.member.open .member-body { display: block; }

.detail { margin-top: .9rem; }
.detail-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 700; margin-bottom: .25rem;
}
.detail-value { color: var(--ink-soft); }
.detail-value a { color: var(--gold); }

.rep-line { color: var(--ink); }
.rep-line .rep-title { color: var(--muted); font-style: italic; font-size: .88rem; }

.contact-grid {
  display: grid; grid-template-columns: 1fr; gap: .8rem; margin-top: .9rem;
}
@media (min-width: 560px) {
  .contact-grid { grid-template-columns: 1fr 1fr; }
}

.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  background: #f4f2ea; border: 1px solid var(--line);
  border-radius: 999px; padding: .32rem .7rem; margin: .15rem .3rem .15rem 0;
  font-size: .9rem; color: var(--ink);
}
.pill .tag {
  font-size: .62rem; font-weight: 700; color: #fff; background: var(--gold);
  border-radius: 4px; padding: .05rem .3rem; letter-spacing: .03em;
}

.empty {
  text-align: center; color: var(--muted);
  padding: 3rem 1rem; font-size: 1rem;
}
.empty strong { color: var(--ink); }

mark { background: #fce7b6; color: inherit; padding: 0 .1em; border-radius: 3px; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center; color: var(--muted); font-size: .8rem;
  padding: 2rem 1rem 3rem; border-top: 1px solid var(--line);
}
.site-footer a { color: var(--muted); text-decoration: underline; }

/* ============================================================
   Admin console
   ============================================================ */
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.admin-header h1 {
  font-family: var(--serif); font-size: 1.4rem; margin: 0;
}
.admin-header .badge {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--gold); font-weight: 700;
}

.btn {
  font: inherit; font-weight: 600; font-size: .92rem;
  border-radius: 9px; padding: .6rem 1.05rem; cursor: pointer;
  border: 1px solid transparent; transition: filter .15s, background .15s;
}
.btn-primary { background: var(--gold); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #f1efe8; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #eecccc; }
.btn-danger:hover { background: #f6dede; }
.btn-sm { padding: .4rem .7rem; font-size: .84rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Login */
.login-card {
  max-width: 380px; margin: 4rem auto; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 2rem 1.8rem;
}
.login-card h2 { font-family: var(--serif); margin: 0 0 .3rem; }
.login-card p { color: var(--muted); margin: 0 0 1.3rem; font-size: .9rem; }

label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .3rem; }
input[type="text"], input[type="password"], input[type="url"], input[type="email"], textarea, select {
  width: 100%; font: inherit; font-size: .95rem; color: var(--ink);
  padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 9px;
  background: var(--card); margin-bottom: .9rem;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(184, 137, 43, .15);
}
textarea { resize: vertical; min-height: 62px; }

.admin-list { display: flex; flex-direction: column; gap: .55rem; margin-top: 1.2rem; }
.admin-row {
  display: flex; align-items: center; gap: .8rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 11px; padding: .7rem .9rem;
}
.admin-row .info { flex: 1 1 auto; min-width: 0; }
.admin-row .info .cat { font-size: .72rem; color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.admin-row .info .co { font-family: var(--serif); font-weight: 600; }
.admin-row .actions { display: flex; gap: .4rem; flex: none; }

.msg { padding: .7rem .9rem; border-radius: 9px; font-size: .9rem; margin-bottom: 1rem; }
.msg-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #eecccc; }
.msg-ok { background: #e7f3ec; color: var(--ok); border: 1px solid #c6e4d1; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 26, 38, .5);
  display: none; align-items: flex-start; justify-content: center;
  padding: 1.5rem 1rem; z-index: 50; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; max-width: 620px; padding: 1.6rem 1.6rem 1.8rem; margin: auto;
}
.modal h2 { font-family: var(--serif); margin: 0 0 1.1rem; font-size: 1.35rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }

.repeat-group { border: 1px dashed var(--line); border-radius: 10px; padding: .8rem; margin-bottom: .9rem; background: #fcfbf7; }
.repeat-group > .rg-label { font-size: .8rem; font-weight: 700; color: var(--ink-soft); margin-bottom: .5rem; display: flex; justify-content: space-between; align-items: center;}
.repeat-item { display: flex; gap: .5rem; align-items: flex-start; margin-bottom: .5rem; }
.repeat-item input { margin-bottom: 0; }
.repeat-item .rm { flex: none; }
.repeat-item .lbl-sel { max-width: 90px; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; }

.hint { font-size: .78rem; color: var(--muted); margin: -.5rem 0 .9rem; }

/* ============================================================
   Board Members page
   ============================================================ */
.board-section { margin-top: 1.8rem; }
.section-title {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
  color: var(--ink); margin: 0 0 1rem;
  padding-bottom: .5rem; border-bottom: 2px solid var(--gold-soft);
}

.board-list { display: flex; flex-direction: column; gap: .6rem; }
.board-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: baseline;
  gap: .2rem 1rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .95rem 1.1rem;
}
.board-role {
  grid-row: 1 / span 2;
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--gold); align-self: center;
}
.board-name { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; color: var(--ink); }
.board-company { color: var(--muted); font-size: .9rem; }
@media (max-width: 520px) {
  .board-item { grid-template-columns: 1fr; }
  .board-role { grid-row: auto; align-self: start; margin-bottom: .1rem; }
}

.committee-list { display: flex; flex-direction: column; gap: .6rem; }
.committee-block {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .95rem 1.1rem;
}
.committee-name {
  font-family: var(--serif); font-weight: 600; font-size: 1.1rem; color: var(--ink);
  margin-bottom: .35rem;
}
.committee-members { display: flex; flex-direction: column; gap: .25rem; }
.cm { color: var(--ink-soft); }
.cm-name { color: var(--ink); font-weight: 600; }
.cm-company { color: var(--muted); font-size: .9rem; }
.chair-tag {
  font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--gold); border-radius: 5px; padding: .1rem .4rem; margin-left: .3rem;
}

/* ============================================================
   Admin tabs + board/committee editors
   ============================================================ */
.admin-tabs {
  display: flex; gap: .3rem; margin-top: 1.2rem;
  border-bottom: 1px solid var(--line);
}
.tab {
  font: inherit; font-weight: 600; font-size: .92rem;
  background: none; border: none; color: var(--muted);
  padding: .7rem 1rem; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

.tab-panel { margin-top: 1.2rem; }
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; margin-bottom: .3rem;
}
.panel-note {
  background: var(--gold-tint); border: 1px solid #ecdfbf; color: #7a5e22;
  border-radius: 10px; padding: .7rem .9rem; font-size: .85rem; margin: 0 0 1rem;
}
.panel-actions {
  display: flex; justify-content: flex-end; gap: .6rem;
  margin-top: 1.1rem; position: sticky; bottom: 0;
  background: linear-gradient(to top, var(--bg) 65%, transparent);
  padding: .8rem 0;
}

/* editor rows */
.editor-row {
  display: flex; gap: .5rem; align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 11px; padding: .6rem .7rem; margin-bottom: .55rem;
}
.editor-row select { margin-bottom: 0; }
.editor-row .b-person { flex: 1 1 auto; min-width: 0; }
.editor-row .b-role { flex: none; width: 160px; }
.editor-row .row-tools { display: flex; gap: .25rem; flex: none; }
.icon-btn {
  font: inherit; border: 1px solid var(--line); background: var(--card);
  color: var(--ink-soft); width: 2rem; height: 2rem; border-radius: 8px;
  cursor: pointer; line-height: 1; font-size: 1rem;
}
.icon-btn:hover { background: #f1efe8; }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

.committee-editor-card {
  background: #fcfbf7; border: 1px solid var(--line);
  border-radius: 12px; padding: .9rem; margin-bottom: 1rem;
}
.committee-editor-card .cc-head {
  display: flex; gap: .5rem; align-items: center; margin-bottom: .6rem;
}
.committee-editor-card .cc-name { margin-bottom: 0; font-weight: 600; }
.cc-member-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.cc-member-row select { margin-bottom: 0; }
.cc-member-row .cm-person { flex: 1 1 auto; min-width: 0; }
.cc-member-row .cm-role { flex: none; width: 120px; }
.cc-sub-actions { margin-top: .3rem; }
