/* ============================================================
   DIRECTORY + PROFILE STYLES — directory.html, profile.html
   Reuses .topbar, .btn, .card, .grid from wizard.css/style.css
   ============================================================ */

.wrap { max-width: 1100px; margin: 0 auto; }

/* ---- Directory toolbar ---- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
}
.toolbar .search {
  flex: 1;
  min-width: 220px;
  padding: 0.5rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
}
.toolbar select {
  padding: 0.5rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  background: #fff;
}
.count-note { font-size: 0.82rem; color: #777; margin-left: auto; white-space: nowrap; }

/* ---- Table ---- */
.table-scroll { overflow-x: auto; }
table.members { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.members th {
  text-align: left;
  padding: 0.6rem 0.7rem;
  background: #f4f6f8;
  border-bottom: 2px solid #e3e8ee;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #555;
}
table.members td {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid #eee;
}
table.members tbody tr:hover { background: #f8fafc; }
table.members a { color: #0052cc; text-decoration: none; font-weight: 600; }
table.members a:hover { text-decoration: underline; }

.pill { padding: 0.2rem 0.6rem; border-radius: 12px; font-size: 0.78rem; font-weight: 700; }
.pill.active   { background: #e3f5ea; color: #1b6e2c; }
.pill.inactive { background: #f4f0e8; color: #8a6d1f; }

/* ---- Pager ---- */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- Profile page ---- */
.profile-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #e8edf3;
}
.avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #0052cc;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.2rem;
  flex-shrink: 0;
}
.profile-head h2 { margin: 0 0 0.2rem; font-size: 1.25rem; }
.profile-head .sub { color: #777; font-size: 0.85rem; }

.detail-group { margin-bottom: 1.5rem; }
.detail-group .section-title {
  font-size: 1rem; font-weight: 700; color: #0052cc;
  margin: 0 0 0.75rem; padding-bottom: 0.35rem;
  border-bottom: 2px solid #e8edf3;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.5rem;
}
.detail-row { display: flex; justify-content: space-between; padding: 0.35rem 0; border-bottom: 1px dashed #eee; }
.detail-row .k { font-weight: 600; color: #555; font-size: 0.85rem; }
.detail-row .v { color: #222; font-size: 0.9rem; text-align: right; }

@media (max-width: 540px) {
  .detail-grid { grid-template-columns: 1fr; }
  .count-note { margin-left: 0; width: 100%; }
}

/* ---- Collapsible submission cards — superadmin.html review queue ---- */
.sub-card {
  border: 1px solid #e8edf3;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.sub-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  background: #fff;
  transition: background 0.12s;
}
.sub-summary::-webkit-details-marker { display: none; } /* hide default disclosure triangle, we draw our own */
.sub-summary:hover { background: #f8fafc; }

.sub-summary .chevron {
  font-size: 0.7rem;
  color: #888;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.sub-card[open] .chevron { transform: rotate(90deg); }

.sub-type-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 10px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.sub-type-pill.new  { background: #e3f5ea; color: #1b6e2c; }
.sub-type-pill.edit { background: #e8f0fe; color: #1a56cc; }

.sub-summary .sub-name { font-weight: 700; color: #222; flex-shrink: 0; }
.sub-summary .sub-meta { color: #888; font-size: 0.82rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sub-summary .sub-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.sub-summary .sub-actions button { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
/* Stop a click on Approve/Reject from also toggling the <details> open/closed */
.sub-summary .sub-actions { pointer-events: auto; }

.sub-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid #f0f2f5;
}
.sub-body .diff-box {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1.5rem;
}
.sub-body .diff-box > div { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.25rem 0; border-bottom: 1px dashed #eee; font-size: 0.85rem; }
.sub-body .diff-box strong { color: #555; font-weight: 600; text-transform: capitalize; }

@media (max-width: 640px) {
  .sub-summary { flex-wrap: wrap; }
  .sub-summary .sub-meta { width: 100%; order: 5; }
  .sub-body .diff-box { grid-template-columns: 1fr; }
}

/* ---- Custom field manager — manage-fields.html ---- */
.field-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1.2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e8edf3;
}
.field-form .field-full { grid-column: 1 / -1; }
.field-form label { font-size: 0.85rem; font-weight: 600; color: #444; display: block; margin-bottom: 0.25rem; }
.field-form input, .field-form select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
}
.field-form .checkbox-inline { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.field-form .checkbox-inline input { width: auto; }

.field-count {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
}
.field-count.warn { color: #a32d2d; font-weight: 600; }

.field-list-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid #e8edf3;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}
.field-list-row .field-section-pill {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  background: #e8f0fe;
  color: #1a56cc;
  flex-shrink: 0;
}
.field-list-row .field-type-tag {
  font-size: 0.75rem;
  color: #777;
  flex-shrink: 0;
}
.field-list-row .field-label { font-weight: 600; flex: 1; }
.field-list-row .field-required-tag { font-size: 0.72rem; color: #a32d2d; font-weight: 700; flex-shrink: 0; }
.field-list-row.inactive { opacity: 0.5; }
.field-list-row .btn-toggle {
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  flex-shrink: 0;
}
