/* ============================================================================
   Admin area shell + shared admin components
   Top section nav, sticky sidebar, content column, and reusable admin building
   blocks (toolbars, filter chips) used across the CRUD pages.
   ========================================================================== */

.admin-topnav { border-bottom: 1px solid var(--border); background: var(--surface); }
.admin-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0; list-style: none; margin: 0; padding: 0; justify-content: center; }
.admin-nav > li { display: inline-flex; }
.admin-nav a { display: inline-block; color: var(--ink); font: 600 0.95rem 'Space Grotesk', sans-serif; padding: 14px 20px; border-bottom: 3px solid transparent; }
.admin-nav a:hover { color: var(--orange-deep); text-decoration: none; }
.admin-nav a.active { color: var(--orange-deep); border-bottom-color: var(--orange); }
.admin-nav .admin-nav-util { margin-left: auto; display: inline-flex; }
.admin-nav .admin-nav-util a { color: var(--text-muted); font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.admin-nav .admin-nav-util a.active { color: var(--orange-deep); }
.admin-nav .admin-nav-util svg { width: 15px; height: 15px; }

.admin-shell { display: flex; gap: 32px; align-items: flex-start; margin-top: 24px; }
.admin-sidebar { flex: 0 0 220px; position: sticky; top: 16px; }
.admin-side { display: flex; flex-direction: column; gap: 2px; }
.admin-side a { color: var(--ink); font: 500 0.92rem 'Instrument Sans', sans-serif; border-radius: 8px; padding: 8px 14px; }
.admin-side a:hover { background: var(--cream); text-decoration: none; }
.admin-side a.active { background: var(--orange); color: #fff; font-weight: 600; }
.admin-sidebar-header { text-transform: uppercase; color: var(--text-muted); font-size: 0.72rem; font-weight: 700; margin: 14px 0 4px; padding: 0 14px; }
.admin-content { flex: 1 1 auto; min-width: 0; }
.admin-content h1 { margin: 0 0 24px; }
@media (max-width: 991px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { position: static; flex-basis: auto; width: 100%; }
}

/* shared admin building blocks */
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.admin-toolbar .admin-meta, .admin-meta.flush { margin: 0; }
.admin-toolbar .grow { flex: 1 1 240px; }
.admin-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.admin-filters a { padding: 6px 14px; border-radius: var(--r-pill); font-size: 0.85rem; font-weight: 600; color: var(--ink); border: 1px solid var(--border); }
.admin-filters a:hover { border-color: var(--orange); text-decoration: none; }
.admin-filters a.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.admin-actions.copy-row { margin-bottom: 10px; }

/* admin stat cards (dashboard) */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 1.05rem; }
.stat-row { display: flex; gap: 28px; flex-wrap: wrap; }
.stat-row .n { font: 700 1.8rem 'Space Grotesk', sans-serif; line-height: 1; color: var(--ink); }
.stat-row .l { color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; }
.admin-meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }
.stat-tile { text-align: center; }
.stat-tile h3 { margin: 8px 0 0; font-weight: 400; font-size: 1.05rem; }
.stat-tile .statnum.ink { color: var(--ink); }
.ink { color: var(--ink); }

/* member detail */
.member-top { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
@media (max-width: 700px) { .member-top { grid-template-columns: 1fr; } }
.member-card { text-align: center; }
.admin-avatar { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; display: block; }
.admin-avatar-ph { width: 160px; height: 160px; border-radius: 50%; background: var(--cream); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; color: var(--text-muted); }
.admin-avatar-ph svg { width: 64px; height: 64px; }
.social-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.ua-truncate { max-width: 32rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* clickable stat filter cards (campaigns) */
.stat-link-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 20px; }
.stat-link { border: 1px solid var(--border); border-radius: var(--r-media); padding: 12px 14px; display: block; color: var(--ink); background: var(--surface); }
.stat-link:hover { border-color: var(--orange); text-decoration: none; }
.stat-link.active { border-color: var(--orange); box-shadow: var(--shadow-card); }
.stat-link .lbl { color: var(--text-muted); font-size: 0.78rem; }
.stat-link .n { font: 400 1.6rem 'Space Grotesk', sans-serif; line-height: 1.2; }
.stat-link .n.c-green { color: var(--live); }
.stat-link .n.c-warn { color: var(--warn-deep); }
.stat-link .n.c-blue { color: var(--blue-deep); }
.stat-link .n.c-red { color: #b42318; }
tr[data-href] { cursor: pointer; }

/* filter chip buttons (campaign recipients) */
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter-btn { padding: 6px 14px; border-radius: var(--r-pill); font-size: 0.85rem; font-weight: 600; color: var(--ink); border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.filter-btn:hover { border-color: var(--orange); }
.filter-btn.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.spread-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.spread-row:last-child { border-bottom: none; }

/* content page editor (two-column) */
.content-edit-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .content-edit-grid { grid-template-columns: 1fr; } }
.form-submit-row { margin-top: 20px; }
.del-form { margin-top: 24px; }
.narrow-form { max-width: 640px; }
.amount-row { grid-template-columns: 1fr auto; align-items: end; }
.paypal-row { margin: 16px 0; }
.decline-panel { margin-top: 16px; }
.reminder-preview-frame { width: 100%; height: 70vh; border: 0; display: block; }
.modal.modal-wide { width: min(860px, 100%); }
.modal-body.flush { padding: 0; }
.stat-sm { font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.flush { margin: 0; }

/* statistics (canvasjs) chrome */
.stat-chart { height: 370px; width: 100%; }
.stats-band { margin: 40px 0; }
.stats-band > h2 { text-align: center; margin-bottom: 24px; }
.stats-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 800px) { .stats-duo { grid-template-columns: 1fr; } }
.stat-tile .chip { margin-top: 8px; }
.admin-filter-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.admin-filter-form .input, .admin-filter-form .select-wrap { flex: 1 1 200px; }
.admin-filter-form .select-wrap .input { flex: none; width: 100%; }
.orange { color: var(--orange-deep); }

/* sortable admin tables */
.sortable-table th.sortable { cursor: pointer; user-select: none; position: relative; padding-right: 1.4em; }
.sortable-table th.sortable::after { content: '\2195'; position: absolute; right: 0.4em; opacity: 0.4; }
.sortable-table th.sortable.sort-asc::after { content: '\2191'; opacity: 1; }
.sortable-table th.sortable.sort-desc::after { content: '\2193'; opacity: 1; }
