/* ============================================
   Admin Page Styles
   ============================================ */

.dash-nav-link {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color 0.2s;
}
.dash-nav-link:hover {
    color: #fff;
}

.admin-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 32px;
    margin-bottom: 24px;
}
.admin-card h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brown-dark);
    margin-bottom: 20px;
}

.admin-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 16px;
    margin-bottom: 16px;
}
.admin-form-row-2 {
    grid-template-columns: 1fr 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}
.admin-form-row .form-group { margin-bottom: 0; }
.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--gray-900);
    background: var(--white);
    transition: border-color 0.2s;
    width: 100%;
}
.form-group textarea {
    resize: vertical;
    min-height: 72px;
    line-height: 1.4;
}
/* Checkboxes are content-sized — exempt them from the 100%-width input styling.
   (A full-width checkbox crushes its label text into a vertical letter stack,
   e.g. the Registered Adult toggle in the member edit modals on mobile.) */
.form-group input[type="checkbox"] {
    width: auto;
    padding: 0;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--tl-blue);
}

.admin-name-link {
    color: var(--tl-blue);
    text-decoration: none;
    font-weight: 600;
}
.admin-name-link:hover { text-decoration: underline; }

.org-logo-preview {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 10px;
    margin-bottom: 10px;
    background: var(--white);
    display: inline-block;
}
.org-logo-preview img {
    max-width: 220px;
    max-height: 110px;
    display: block;
}

.btn {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, filter 0.15s;
    padding: 10px 22px;
    font-size: 0.9rem;
}
.btn:active { transform: scale(0.98); }
.btn-primary { color: #fff; background: var(--green-forest, #2e5931); }
.btn-primary:hover:not(:disabled) { filter: brightness(0.92); }
.btn-primary:disabled { background: var(--gray-500, #9a9a9a); cursor: not-allowed; }
.btn-secondary { color: var(--gray-700, #555); background: var(--gray-100, #f2f2f2); border-color: var(--gray-200, #e0e0e0); }
.btn-secondary:hover { background: var(--gray-200, #e0e0e0); }

.btn-invite {
    margin-top: 8px;
    max-width: 260px;
}

.btn-send-text {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    font-size: 0.9rem;
    background: var(--green-forest);
    color: #fff;
    border-radius: var(--radius);
    transition: background 0.2s;
}
.btn-send-text:hover {
    background: var(--green-pine);
}

/* --- Messages --- */
.admin-message {
    margin-top: 12px;
    font-size: 0.85rem;
    border-radius: var(--radius);
    min-height: 0;
}
.admin-message:empty {
    display: none;
}
.admin-message.error {
    display: block;
    padding: 10px 14px;
    background: #fdf0f0;
    color: var(--crimson);
    border: 1px solid rgba(186,39,44,0.15);
}
.admin-message.success {
    display: block;
    padding: 10px 14px;
    background: #f0fdf4;
    color: #2D5E2A;
    border: 1px solid rgba(45,94,42,0.15);
}

/* --- Invites table --- */
.invites-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.invites-table th {
    text-align: left;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    padding: 8px 12px;
    border-bottom: 2px solid var(--gray-200);
}
.invites-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}
.invites-table tr:last-child td {
    border-bottom: none;
}

/* Wide admin tables scroll INSIDE their card at every width, not just on
   phones. These wrappers only had overflow-x in the mobile media query, so a
   table with enough columns (Trailmen gained a select box and an ID-card
   column) spilled out past the card on a desktop screen. */
.invites-list,
.trailmen-list,
.families-list,
.members-list,
.signup-list,
.registered-adults-list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
/* Keep columns legible while scrolling rather than crushing them. */
.trailmen-table { min-width: 900px; }
/* TLC link + Print ID sit together in one cell so the table didn't need an
   extra column; they wrap instead of widening the row. */
.tlc-cell-btns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-pending {
    background: #FFF8E1;
    color: #876237;
}
.status-accepted {
    background: #f0fdf4;
    color: #2D5E2A;
}

.btn-remove {
    background: none;
    border: 1px solid var(--crimson);
    color: var(--crimson);
    font-family: var(--font-body);
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-remove:hover {
    background: var(--crimson);
    color: #fff;
}

.invites-empty,
.invites-loading {
    font-size: 0.9rem;
    color: var(--gray-500);
    text-align: center;
    padding: 24px 0;
}

/* --- Inline selects in tables --- */
.family-select,
.role-select {
    padding: 4px 8px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--gray-700);
    background: var(--white);
    cursor: pointer;
}
.family-select:focus,
.role-select:focus {
    outline: none;
    border-color: var(--tl-blue);
}

/* --- Family groups --- */
.family-group {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 16px;
}
.family-group-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brown-dark);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-200);
}
.family-group-members {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.family-group-member {
    font-size: 0.85rem;
    color: var(--gray-700);
    padding: 6px 0;
}
.family-group-role {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--tl-blue);
    color: #fff;
    margin-right: 6px;
}
.family-group-detail {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-left: 8px;
}

/* --- Announcement --- */
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--gray-900);
    background: var(--white);
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s;
}
.form-group textarea:focus {
    outline: none;
    border-color: var(--tl-blue);
}
.announcement-char-count {
    font-size: 0.75rem;
    color: var(--gray-500);
}
.announcement-char-count.over-limit {
    color: var(--crimson);
    font-weight: 700;
}
.char-hint { color: var(--gray-500); font-weight: 400; }
.broadcast-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: -8px 0 16px;
}

/* Insert event/announcement link picker row */
.insert-link-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 16px;
    flex-wrap: wrap;
}
.insert-link-select {
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: var(--gray-100);
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--tl-blue);
    cursor: pointer;
    max-width: 100%;
}
.insert-link-select:hover { background: var(--white); }
.insert-link-select:focus { outline: none; border-color: var(--tl-blue); }
.insert-target-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-style: italic;
    margin-left: auto;
}

/* Quill editor for email body */
#emailEditor { background: var(--white); min-height: 180px; }
#emailEditor .ql-editor { min-height: 160px; font-family: 'Open Sans', sans-serif; }
#emailEditor.ql-snow { border-radius: 0 0 6px 6px; }
#emailEditor + .ql-toolbar.ql-snow { border-radius: 6px 6px 0 0; }
/* Constrain images in the editor preview so the admin sees what recipients will see */
#emailEditor .ql-editor img { max-width: 100%; height: auto; }
/* Give blocks real spacing (Quill resets them to margin:0). These em-based margins
   mirror the inline margins the server applies in spaceBlocks() (functions/index.js),
   so the editor preview matches the sent email: a normal gap between paragraphs and
   a bit more above headings. Keep the two in sync if you change one. */
#emailEditor .ql-editor p,
#emailEditor .ql-editor blockquote,
#emailEditor .ql-editor ul,
#emailEditor .ql-editor ol { margin: 0 0 0.9em; }
#emailEditor .ql-editor h1,
#emailEditor .ql-editor h2,
#emailEditor .ql-editor h3,
#emailEditor .ql-editor h4 { margin: 1.1em 0 0.35em; }
.show-recipients-link {
    font-size: 0.85rem;
    color: var(--tl-blue);
    text-decoration: underline;
}
.show-recipients-link:hover { color: var(--crimson); }
#recipientCountHint {
    color: var(--gray-500);
    font-size: 0.78rem;
    text-decoration: none;
    margin-left: 4px;
}

/* Recipients modal */
.recipients-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
}
.recipients-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 27, 22, 0.55);
}
.recipients-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(30, 27, 22, 0.25);
    overflow: hidden;
}
.recipients-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}
.recipients-header h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.15rem;
    color: var(--brown-dark);
    margin: 0;
}
.recipients-close {
    background: none;
    border: 0;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    padding: 0 8px;
}
.recipients-close:hover { color: var(--crimson); }
.recipients-summary {
    padding: 14px 20px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.95rem;
}
.recipients-list {
    max-height: 60vh;
    overflow-y: auto;
}
.recipient-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.88rem;
}
.recipient-row:last-child { border-bottom: 0; }
.recipient-name {
    font-weight: 600;
    color: var(--gray-900);
}
.recipient-contact {
    color: var(--gray-700);
    font-size: 0.85rem;
    word-break: break-word;
}
.recipient-contact a { color: var(--tl-blue); text-decoration: none; }
.recipient-contact a:hover { text-decoration: underline; }
.recipient-channels {
    display: flex;
    gap: 4px;
}
.ch-badge {
    font-family: 'Oswald', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 10px;
}
.ch-sms { background: var(--tl-blue); color: #fff; }
.ch-email { background: #6B7280; color: #fff; }
.recipients-empty {
    color: var(--gray-500);
    font-size: 0.9rem;
    text-align: center;
    padding: 32px 16px;
    margin: 0;
}
@media (max-width: 600px) {
    .recipient-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
body.modal-open { overflow: hidden; }

/* --- Paste-a-list recipients --- */
.paste-recipients {
    width: 100%;
    resize: vertical;
    font-family: inherit;
    font-size: 0.9rem;
}
.paste-parse-hint {
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--gray-500);
    min-height: 1em;
}
.paste-parse-hint.has-skipped { color: #9a6a1f; }

/* --- Already-received review (recipients modal) --- */
.recipients-already {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #FFF1D6;
    color: #876237;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--gray-100);
}
.recipients-already-text strong { color: #6e4e25; }
.recipients-already .btn { padding: 6px 12px; font-size: 0.8rem; white-space: nowrap; }
.recipients-warning {
    padding: 10px 20px;
    background: #FDECEC;
    color: #9b2c2c;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--gray-100);
}
.recipient-already-badge {
    display: inline-block;
    margin-left: 8px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #876237;
    background: #FFF1D6;
    padding: 2px 7px;
    border-radius: 10px;
    vertical-align: middle;
    white-space: nowrap;
}
.recipient-row-excluded { opacity: 0.5; }
.recipient-row-excluded .recipient-name { text-decoration: line-through; }
.recipient-exclude {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--gray-700);
    cursor: pointer;
    white-space: nowrap;
}
.recipient-exclude input { cursor: pointer; }

/* --- Sent log --- */
.broadcast-templates-hint {
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: var(--gray-500);
}
.sentlog-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-100);
}
.sentlog-filter {
    flex: 1 1 160px;
    padding: 8px 11px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9rem;
}
.sentlog-toolbar .btn { white-space: nowrap; }
.sentlog-when {
    display: block;
    font-size: 0.78rem;
    color: var(--gray-500);
    font-weight: 400;
    margin-top: 2px;
}
.announcement-preview {
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--gray-700);
    line-height: 1.6;
    white-space: pre-wrap;
}
.announcement-preview strong {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    margin-bottom: 6px;
}

/* --- Sign Up Status --- */
.admin-section-desc {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 20px;
}
.signup-status-family {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 16px;
}
.signup-status-family-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brown-dark);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-200);
}
.signup-status-member {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}
.signup-status-member:last-child {
    margin-bottom: 0;
}
.signup-status-adult {
    border-left: 3px solid var(--tl-blue);
}
.signup-status-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.signup-status-header strong {
    font-size: 0.95rem;
    color: var(--brown-dark);
}
.signup-status-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 8px;
}
.signup-check-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--gray-700);
    cursor: pointer;
    white-space: nowrap;
}
.signup-check-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--green-forest);
    cursor: pointer;
}
.signup-status-meta {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
}
.status-inprogress {
    background: #E8F0FE;
    color: var(--tl-blue);
}

/* --- Trailmen list --- */
.trailmen-table tr.trailman-row {
    cursor: pointer;
    transition: background 0.15s;
}
.trailmen-table tr.trailman-row:hover {
    background: var(--gray-100);
}
.dues-cell { white-space: nowrap; }
.dues-paid {
    display: inline-block;
    color: #2D5E2A;
    font-weight: 600;
    font-size: 0.78rem;
    background: #DBEDD9;
    padding: 3px 10px;
    border-radius: 10px;
}
.dues-processing {
    display: inline-block;
    color: #004B87;
    font-weight: 600;
    font-size: 0.78rem;
    background: #DDE9F4;
    padding: 3px 10px;
    border-radius: 10px;
}
.dues-pending {
    color: var(--gray-500);
    font-size: 0.78rem;
    font-style: italic;
}
.btn-row-mark-paid {
    background: var(--white);
    border: 1px solid var(--tl-blue);
    color: var(--tl-blue);
    font-size: 0.78rem;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}
.btn-row-mark-paid:hover {
    background: var(--tl-blue);
    color: #fff;
}
.group-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    background: var(--gray-500);
}
.group-fox { background: #C9652E; }
.group-hawk { background: #876237; }
.group-mountainLion { background: #3E2E18; }
.group-navigator { background: var(--tl-blue); }
.group-adventurer { background: var(--green-forest); }
.group-swampFathers { background: #4A5C3A; }
.group-none { background: var(--gray-500); }
.group-override-tag {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    font-style: italic;
}

/* --- Trailman detail page --- */
.trailman-back {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--gray-500);
    text-decoration: none;
    margin-bottom: 16px;
    transition: color 0.2s;
}
.trailman-back:hover {
    color: var(--tl-blue);
}
.trailman-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}
.trailman-name {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--brown-dark);
    margin: 0;
}
.trailman-sub {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-top: 4px;
}
.trailman-header-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.trailman-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
.trailman-info-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
}
.trailman-info-row:last-child { border-bottom: none; }
.trailman-info-label {
    color: var(--gray-500);
    font-weight: 600;
}
.trailman-info-value {
    color: var(--gray-900);
    text-align: right;
}
.trailman-field-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    margin-bottom: 4px;
}
.trailman-field-value {
    font-size: 1rem;
    color: var(--brown-dark);
    font-weight: 600;
    margin-bottom: 4px;
}
.trailman-select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    background: var(--white);
    cursor: pointer;
}
.trailman-select:focus { outline: none; border-color: var(--tl-blue); }
.trailman-hint {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 10px;
    line-height: 1.5;
}
.trailman-save-msg {
    font-size: 0.8rem;
    margin-top: 8px;
    min-height: 1em;
}
.trailman-save-msg.saved { color: #2D5E2A; }
.trailman-save-msg.error { color: var(--crimson); }
.trailman-checklist {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.trailman-check-readonly {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.trailman-check-status {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 10px;
    border-radius: 10px;
    margin-left: auto;
}
.trailman-check-status-paid        { background: #DBEDD9; color: #2D5E2A; }
.trailman-check-status-scholarship { background: #E8DEF8; color: #5A2B7A; }
.trailman-check-status-processing  { background: #DDE9F4; color: #004B87; }
.trailman-check-status-unpaid      { background: var(--gray-100); color: var(--gray-500); }
.btn-award-scholarship {
    background: var(--white);
    border: 1px solid #5A2B7A;
    color: #5A2B7A;
    font-family: 'Oswald', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: auto;
    white-space: nowrap;
}
.btn-award-scholarship:hover { background: #5A2B7A; color: #fff; }
.btn-award-scholarship:disabled { opacity: 0.6; cursor: default; }
.btn-unmark-dues {
    background: var(--white);
    border: 1px solid #c93939;
    color: #c93939;
    font-family: 'Oswald', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: auto;
    white-space: nowrap;
}
.btn-unmark-dues:hover { background: #c93939; color: #fff; }
.btn-unmark-dues:disabled { opacity: 0.6; cursor: default; }

.btn-mark-dues-paid {
    background: var(--white);
    border: 1px solid #2D5E2A;
    color: #2D5E2A;
    font-family: 'Oswald', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: auto;
    white-space: nowrap;
}
.btn-mark-dues-paid:hover { background: #2D5E2A; color: #fff; }
.btn-mark-dues-paid:disabled { opacity: 0.6; cursor: default; }

.btn-edit-trailman {
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-family: 'Oswald', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
}
.btn-edit-trailman:hover { background: var(--tl-blue); color: #fff; border-color: var(--tl-blue); }
.dues-partial-note {
    font-size: 0.72rem;
    color: #5A2B7A;
    margin-bottom: 4px;
}

/* --- Generic modal (used by Award Scholarship and others) --- */
.modal {
    position: fixed; inset: 0;
    z-index: 1000;
    display: none;
    align-items: center; justify-content: center;
    padding: 20px;
}
.modal.open { display: flex; }
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(30, 27, 22, 0.55);
}
.modal-card {
    position: relative;
    background: var(--white);
    border-radius: 10px;
    width: 100%;
    max-width: 480px;
    padding: 26px 30px 22px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.modal-close {
    position: absolute; top: 10px; right: 12px;
    background: transparent; border: none;
    font-size: 1.6rem; line-height: 1;
    cursor: pointer; color: var(--gray-500);
    padding: 0; width: 32px; height: 32px;
}
.modal-close:hover { color: var(--gray-700); }
.modal-actions {
    display: flex; justify-content: flex-end;
    gap: 10px; margin-top: 18px;
    padding-top: 14px; border-top: 1px solid var(--gray-200);
}

/* Award Scholarship modal-specific */
.award-dues-info {
    display: flex; justify-content: space-between; align-items: baseline;
    background: #F4EFE5; border-radius: 6px;
    padding: 10px 14px; margin: 0 0 18px;
    font-size: 0.92rem; color: var(--gray-700);
}
.award-dues-info strong { font-size: 1.05rem; color: #3E2E18; font-family: 'Oswald', sans-serif; }
.award-prorated { font-size: 0.78rem; color: var(--gray-500); margin-left: 4px; }

.award-amount-input { position: relative; }
.award-amount-input .award-currency {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--gray-500); font-weight: 600; pointer-events: none;
}
.award-amount-input input {
    padding-left: 24px !important;
    font-size: 1.1rem !important;
    font-family: 'Oswald', sans-serif !important;
}

.award-check-label {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 6px 0 4px; padding: 8px 0;
    font-size: 0.92rem; cursor: pointer; color: var(--gray-900);
}
.award-check-label > span {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.4;
}
.award-check-label input[type="checkbox"] {
    flex: 0 0 auto;
    margin-top: 2px;
    transform: scale(1.1);
    accent-color: #5A2B7A;
}

.award-coverage-hint {
    font-size: 0.86rem; line-height: 1.45;
    margin: 6px 0 0; padding: 9px 12px;
    border-radius: 5px;
}
.award-coverage-hint.full        { background: #DBEDD9; color: #2D5E2A; border-left: 3px solid #2D5E2A; }
.award-coverage-hint.partial     { background: #FFF1D6; color: #876237; border-left: 3px solid #D4A017; }
.award-coverage-hint.partial-override { background: #F3E5F5; color: #5A2B7A; border-left: 3px solid #5A2B7A; }

/* Shared receipt modal styles (used by payments.html + ledger.html) */
.receipt-modal-card {
    max-width: 480px !important;
}
.receipt-modal-card .receipt-header {
    background: #f7f4ed; border-radius: 6px;
    padding: 10px 14px; margin: 8px 0 18px;
    font-weight: 600; color: #3E2E18;
}
.receipt-section { margin-bottom: 16px; }
.receipt-subhead {
    font-family: 'Oswald', sans-serif;
    font-size: 0.78rem; color: var(--gray-700);
    text-transform: uppercase; letter-spacing: 0.05em;
    margin: 0 0 6px;
}
.receipt-modal-card .receipt-row { display: flex; gap: 8px; }
.receipt-modal-card .receipt-row input {
    flex: 1; padding: 8px 10px;
    border: 1px solid var(--gray-200); border-radius: 6px;
    font-size: 0.92rem;
}
.receipt-status { margin: 8px 0 0; font-size: 0.88rem; min-height: 1.2em; }
.receipt-status.success { color: #2D5E2A; }
.receipt-status.error { color: #c93939; }

/* Receipt button on the ledger entry list */
.ledger-receipt-btn {
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 1rem;
    border-radius: 4px;
    transition: background 0.15s, border-color 0.15s;
}
.ledger-receipt-btn:hover {
    background: #f7f4ed;
    border-color: var(--gray-200);
}

.award-success-banner {
    background: #DBEDD9;
    color: #2D5E2A;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 4px solid #2D5E2A;
    transition: opacity 0.7s;
}

.admin-message.success {
    background: #DBEDD9;
    color: #2D5E2A;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
    margin: 8px 0 0;
}
.dues-scholarship {
    display: inline-block;
    color: #5A2B7A;
    font-weight: 600;
    font-size: 0.78rem;
    background: #E8DEF8;
    padding: 3px 10px;
    border-radius: 10px;
}
.trailman-checklist-hint {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-top: 8px;
    font-style: italic;
}
.trailman-checklist-hint a { color: var(--tl-blue); }
@media (max-width: 768px) {
    .trailman-grid { grid-template-columns: 1fr; }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .admin-form-row {
        grid-template-columns: 1fr;
    }
    .btn-invite {
        max-width: 100%;
    }
    .invites-table {
        font-size: 0.8rem;
    }
    .invites-table th,
    .invites-table td {
        padding: 8px 6px;
    }
}

/* --- Admin hub page --- */
.admin-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.admin-hub-card {
    display: block;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.admin-hub-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 27, 22, 0.08);
    border-color: var(--tl-blue);
}
.admin-hub-card h2 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tl-blue);
    margin-bottom: 8px;
}
.admin-hub-card p {
    font-size: 0.9rem;
    color: var(--gray-500);
    line-height: 1.5;
    margin: 0;
}
.admin-hub-card-featured {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f7faff 0%, #fff 100%);
    border-color: var(--tl-blue);
}
.admin-hub-card-featured h2 { font-size: 1.15rem; }

/* --- Action modal (delete / inactivate / reactivate) --- */
.action-modal {
    position: fixed; inset: 0;
    z-index: 950;
    display: none;
    align-items: center; justify-content: center;
    padding: 20px;
}
.action-modal.open { display: flex; }
.action-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(30, 27, 22, 0.55);
}
.action-modal-dialog {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.action-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}
.action-modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--brown-dark);
    margin: 0;
}
.action-modal-close {
    background: transparent; border: none;
    font-size: 1.4rem; line-height: 1;
    cursor: pointer;
    color: var(--gray-500);
}
.action-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}
.action-modal-footer { flex: 0 0 auto; }
.action-modal-header { flex: 0 0 auto; }
.action-modal-warn {
    background: #fdf0f0;
    color: var(--crimson);
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 14px;
}
.action-form-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 12px;
    margin-bottom: 16px;
}
.action-form-row label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
}
.action-form-row input {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    margin-top: 4px;
}
.action-form-row input:focus { outline: none; border-color: var(--tl-blue); }
.action-modal-section {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}
.action-modal-relatives {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius);
    padding: 6px 8px;
    background: var(--gray-100);
}
.action-relative {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px;
    font-size: 0.88rem;
    border-radius: 4px;
    cursor: pointer;
}
.action-relative:hover { background: var(--white); }
.action-relative.already { opacity: 0.55; cursor: default; }
.action-relative input[type="checkbox"] {
    margin-top: 3px;
    width: 16px; height: 16px;
    accent-color: var(--tl-blue);
}
.action-relative-meta {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-left: 4px;
}
.action-relative-coll {
    background: var(--gray-200);
    padding: 1px 6px;
    border-radius: 10px;
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.action-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-100);
}
.btn-danger { background: var(--crimson); color: #fff; }
.btn-danger:hover { background: #8E1E22; color: #fff; }

/* --- Row actions + inactive state --- */
.row-actions { display: inline-flex; gap: 6px; }
.row-actions button {
    font-size: 0.72rem;
    padding: 4px 9px;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-700);
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.15s;
}
.row-actions button:hover { border-color: var(--tl-blue); color: var(--tl-blue); }
.row-actions .btn-row-delete:hover { border-color: var(--crimson); color: var(--crimson); }
.row-actions .btn-convert { border-color: #2D5E2A; color: #2D5E2A; }
.row-actions .btn-convert:hover { background: #2D5E2A; color: #fff; }
.modal-intro { margin: 0 0 14px; color: var(--gray-700, #555); }
.merge-warn { font-size: 0.85rem; color: #876237; background: #FFF8E1; border: 1px solid #f0e2b8; border-radius: 6px; padding: 8px 11px; margin: 12px 0; }
.inactive-row {
    opacity: 0.55;
}
.inactive-row:hover { opacity: 0.8; }
.inactive-badge {
    display: inline-block;
    background: #ECECEC;
    color: #4A453D;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: 6px;
}
.inactive-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-left: 6px;
    font-style: italic;
}

/* --- "Include inactive" filter --- */
.filter-bar {
    display: flex;
    justify-content: flex-end;
    padding: 0 0 12px;
}
.filter-bar label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--gray-700);
    cursor: pointer;
}
.filter-bar input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--tl-blue);
}

/* --- Trailmen page: counts + filters --- */
.tm-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 18px;
}
.tm-count-group {
    flex: 1 1 280px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 14px 16px;
}
.tm-count-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-700);
    margin-bottom: 10px;
}
.tm-count-total {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--gray-500);
}
.tm-count-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tm-count-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px 4px 4px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
}
/* Status chips use the light status-badge palettes — keep their dark text. */
.tm-count-chip.status-pending { color: #876237; }
.tm-count-chip.status-accepted { color: #2D5E2A; }
.tm-count-chip.status-inprogress { color: var(--tl-blue); }
.tm-count-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    font-size: 0.82rem;
    font-weight: 700;
}
.tm-count-chip.status-pending .tm-count-num,
.tm-count-chip.status-accepted .tm-count-num,
.tm-count-chip.status-inprogress .tm-count-num {
    background: rgba(0, 0, 0, 0.08);
}
.tm-count-empty {
    font-size: 0.82rem;
    color: var(--gray-500);
}

/* Waiting (days since signup, incomplete checklist) */
.waiting-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.waiting-ok { background: #f0fdf4; color: #2D5E2A; }
.waiting-warn { background: #FFF8E1; color: #876237; }
.waiting-late { background: #fdecea; color: #b3261e; }
.waiting-done { color: var(--gray-400); }
.tm-count-chip.waiting-ok { color: #2D5E2A; }
.tm-count-chip.waiting-warn { color: #876237; }
.tm-count-chip.waiting-late { color: #b3261e; }
.tm-count-chip.waiting-ok .tm-count-num,
.tm-count-chip.waiting-warn .tm-count-num,
.tm-count-chip.waiting-late .tm-count-num {
    background: rgba(0, 0, 0, 0.08);
}

.tm-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 18px;
    padding-bottom: 16px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--gray-200);
}
.tm-filters label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-700);
}
.tm-filters select {
    padding: 6px 10px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: var(--font-body);
    background: var(--white);
    min-width: 150px;
}
.tm-filters-toggle {
    flex-direction: row !important;
    align-items: center;
    gap: 6px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-family: var(--font-body) !important;
    font-size: 0.85rem !important;
    color: var(--gray-700);
    cursor: pointer;
    margin-left: auto;
}
.tm-filters-toggle input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--tl-blue);
}

.family-group-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-200);
}
.family-group-heading .family-group-title { margin: 0; padding: 0; border: none; }

.ra-toggle { width: 18px; height: 18px; accent-color: var(--green-forest); vertical-align: middle; margin-right: 6px; cursor: pointer; }
.ra-toggle + .status-badge { vertical-align: middle; }

.leader-interest-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #FFF2E5;
    color: #C9652E;
    border-radius: 10px;
}

/* --- Signup: leader-interest checkbox --- */
.signup-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--gray-700);
    cursor: pointer;
    line-height: 1.4;
}
.signup-check input[type="checkbox"] {
    width: 18px; height: 18px;
    margin-top: 2px;
    accent-color: var(--tl-blue);
    cursor: pointer;
}

/* --- Contact Inbox --- */
.contact-inbox-tabs {
    display: flex;
    gap: 4px;
    margin: 12px 0 16px;
    border-bottom: 1px solid var(--tl-border, #e0e0e0);
}
.contact-inbox-tab {
    background: none;
    border: none;
    padding: 10px 20px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}
.contact-inbox-tab:hover { color: #333; }
.contact-inbox-tab.active {
    color: var(--tl-green, #2e5931);
    border-bottom-color: var(--tl-green, #2e5931);
}
.contact-inbox-count {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
}
.contacts-list { display: flex; flex-direction: column; gap: 10px; }
.contact-row {
    border: 1px solid var(--tl-border, #e0e0e0);
    border-radius: 6px;
    background: var(--white);
    transition: box-shadow 0.15s;
}
.contact-row:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.contact-row.archived { opacity: 0.7; background: #fafafa; }
.contact-row-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    cursor: pointer;
}
.contact-check {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    cursor: pointer;
}
.contact-check input[type="checkbox"] {
    width: 20px; height: 20px;
    accent-color: var(--tl-green, #2e5931);
    cursor: pointer;
}
.contact-check-label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.contact-row-main { flex: 1; min-width: 0; }
.contact-row-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: #222;
}
.contact-row.archived .contact-row-name { text-decoration: line-through; color: #888; }
.contact-row-meta {
    font-size: 0.9rem;
    color: #666;
    margin-top: 2px;
}
.contact-row-meta a { color: var(--tl-blue, #1a5490); text-decoration: none; }
.contact-row-meta a:hover { text-decoration: underline; }
.contact-row-date {
    font-size: 0.85rem;
    color: #888;
    flex-shrink: 0;
    white-space: nowrap;
}
.contact-row-body {
    display: none;
    padding: 4px 16px 16px 56px;
    border-top: 1px solid var(--tl-border, #e0e0e0);
}
.contact-row.expanded .contact-row-body { display: block; }
.contact-row-details {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}
.contact-row-message {
    background: #f7f7f7;
    padding: 12px 14px;
    border-radius: 4px;
    line-height: 1.55;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}
.contact-row-archived-at {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
}
@media (max-width: 600px) {
    .contact-row-header { flex-wrap: wrap; }
    .contact-row-date { width: 100%; text-align: right; margin-top: 4px; }
    .contact-row-body { padding-left: 16px; }
}

/* Status badges on contact rows */
.contact-status-badge {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}
.contact-status-badge.status-new        { background: #e8f0fe; color: #1a5490; }
.contact-status-badge.status-interested { background: #fff4d6; color: #8a6508; }
.contact-status-badge.status-joined     { background: #d9f2dd; color: #2e5931; }
.contact-status-badge.status-archived   { background: #ececec; color: #666; }

.contact-row.status-archived { opacity: 0.75; background: #fafafa; }
.contact-row.status-joined   { border-left: 3px solid #2e8b3a; }
.contact-row.status-interested { border-left: 3px solid #d4a017; }
.contact-row.is-scholarship { border-left: 3px solid #6a1b9a; }

.contact-type-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
}
.contact-type-scholarship {
    background: #f3e5f5;
    color: #6a1b9a;
}

.scholarship-details {
    background: #faf6fc;
    border: 1px solid #e7d8ee;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 8px 0 4px;
    font-size: 0.92rem;
}
.scholarship-section {
    font-size: 0.74rem;
    font-weight: 700;
    color: #6a1b9a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 10px;
    margin-bottom: 4px;
}
.scholarship-section:first-child { margin-top: 0; }
.scholarship-row {
    display: flex;
    gap: 10px;
    padding: 3px 0;
    line-height: 1.45;
}
.scholarship-label {
    flex: 0 0 130px;
    color: #6b5a78;
    font-weight: 600;
}
.scholarship-value {
    flex: 1;
    color: #2b1a36;
}
@media (max-width: 600px) {
    .scholarship-row { flex-direction: column; gap: 0; }
    .scholarship-label { flex-basis: auto; }
}

/* Action buttons inside the expanded row body */
.contact-row-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.contact-action-btn {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 7px 14px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: filter 0.15s, background 0.15s;
}
.contact-action-btn:hover { filter: brightness(0.95); }
.contact-action-btn.btn-interested { background: #d4a017; color: #fff; }
.contact-action-btn.btn-joined     { background: #2e8b3a; color: #fff; }
.contact-action-btn.btn-archive    { background: #eee; color: #444; border-color: #d0d0d0; }
.contact-action-btn.btn-restore    { background: var(--white); color: #1a5490; border-color: #b8d0e8; }
.contact-action-btn.btn-delete     { background: var(--white); color: #c93939; border-color: #e8b8b8; }
.contact-action-btn.btn-delete:hover { background: #c93939; color: #fff; }

/* --- Add Contact button in tab bar --- */
.contact-inbox-tabs { align-items: center; }
.contact-add-btn {
    margin-left: auto;
    margin-bottom: 6px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 7px 14px;
    background: var(--tl-green, #2e5931);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: filter 0.15s;
}
.contact-add-btn:hover { filter: brightness(0.92); }
@media (max-width: 600px) {
    .contact-add-btn { margin-left: 0; margin-top: 6px; width: 100%; }
}

/* --- Add Contact modal --- */
.contact-modal {
    position: fixed; inset: 0;
    z-index: 950;
    display: none;
    align-items: center; justify-content: center;
    padding: 20px;
}
.contact-modal.open { display: flex; }
.contact-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(30, 27, 22, 0.55);
}
.contact-modal-dialog {
    position: relative;
    background: var(--white);
    border-radius: 8px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.contact-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--tl-border, #e0e0e0);
}
.contact-modal-header h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    color: var(--tl-green, #2e5931);
    margin: 0;
}
.contact-modal-close {
    background: transparent; border: none;
    font-size: 1.6rem; line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 0 4px;
}
.contact-modal-close:hover { color: #222; }
.contact-modal-body {
    padding: 18px 20px 4px;
    overflow-y: auto;
}
.contact-modal-note {
    font-size: 0.88rem;
    color: #555;
    margin: 0 0 14px;
    line-height: 1.45;
}
.contact-field {
    display: block;
    margin-bottom: 12px;
}
.contact-field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
    margin-bottom: 4px;
}
.contact-field-required { color: #c33; }
.contact-field input,
.contact-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid var(--tl-border, #e0e0e0);
    border-radius: 4px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.95rem;
    box-sizing: border-box;
}
.contact-field textarea { resize: vertical; min-height: 72px; }
.contact-field input:focus,
.contact-field textarea:focus {
    outline: none;
    border-color: var(--tl-blue, #1a5490);
}
.contact-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 500px) {
    .contact-field-row { grid-template-columns: 1fr; gap: 0; }
}
.contact-modal-error {
    background: #fdf0f0;
    color: #a62828;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.88rem;
    margin: 4px 0 14px;
}
.contact-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid var(--tl-border, #e0e0e0);
    background: #fafafa;
}
.contact-modal-cancel,
.contact-modal-save {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
}
.contact-modal-cancel {
    background: var(--white);
    color: #555;
    border-color: #ccc;
}
.contact-modal-cancel:hover { background: #f2f2f2; }
.contact-modal-save {
    background: var(--tl-green, #2e5931);
    color: #fff;
}
.contact-modal-save:hover:not(:disabled) { filter: brightness(0.92); }
.contact-modal-save:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- Announcement individual recipient picker --- */
.recipient-picker {
    position: relative;
    border: 1.5px solid var(--tl-border, #e0e0e0);
    border-radius: 4px;
    padding: 6px 8px;
    background: var(--white);
    min-height: 42px;
}
.recipient-picker:focus-within { border-color: var(--tl-blue, #1a5490); }
.recipient-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}
.recipient-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 4px 3px 10px;
    background: #e8f0fe;
    color: #1a5490;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}
.recipient-chip-type {
    font-size: 0.7rem;
    font-weight: 500;
    color: #666;
    background: var(--white);
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 2px;
}
.recipient-chip-remove {
    background: transparent;
    border: none;
    color: #1a5490;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 4px;
}
.recipient-chip-remove:hover { color: #b33; }
.recipient-search-input {
    width: 100%;
    border: none;
    outline: none;
    padding: 4px 4px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.95rem;
    background: transparent;
}
.recipient-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--tl-border, #e0e0e0);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
}
.recipient-result {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}
.recipient-result:last-child { border-bottom: none; }
.recipient-result:hover,
.recipient-result.active { background: #f5faff; }
.recipient-result-name { font-weight: 600; color: #222; }
.recipient-result-meta { font-size: 0.8rem; color: #666; margin-top: 2px; }
.recipient-result-type {
    float: right;
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f0f0f0;
    padding: 2px 7px;
    border-radius: 8px;
    font-weight: 600;
}
.recipient-result-empty {
    padding: 12px;
    color: #888;
    font-style: italic;
    text-align: center;
    font-size: 0.9rem;
}

/* --- Health Form view (trailman page) --- */
.hf-view-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.hf-view-header h2 { margin: 0; }
.hf-submitted { color: #888; font-size: 0.9rem; }
.hf-summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}
.hf-chip {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}
.hf-chip-ok   { background: #e8f5e9; color: #2e5931; }
.hf-chip-warn { background: #fff4d6; color: #8a6508; }
.hf-chip-info { background: #e8f0fe; color: #1a5490; }
.hf-view-toggle { margin-top: 4px; }
.hf-details-panel {
    display: none;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--tl-border, #e0e0e0);
}
.hf-details-panel.open { display: block; }
.hf-view-h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.05rem;
    color: #2e5931;
    margin: 22px 0 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--tl-border, #e0e0e0);
}
.hf-view-h3:first-child { margin-top: 0; }
.hf-view-kv {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 6px 20px;
}
.hf-view-kv-row { display: flex; gap: 8px; align-items: baseline; font-size: 0.93rem; }
.hf-view-kv-label { color: #777; min-width: 130px; font-weight: 500; }
.hf-view-kv-value { color: #222; flex: 1; word-break: break-word; }
.hf-view-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: 8px;
}
.hf-view-table th,
.hf-view-table td {
    text-align: left;
    padding: 6px 10px;
    border-bottom: 1px solid var(--tl-border, #e8e8e8);
    vertical-align: top;
}
.hf-view-table th { color: #555; font-weight: 600; background: #fafafa; }
.hf-view-empty { color: #888; font-style: italic; font-size: 0.9rem; margin: 4px 0 8px; }
.hf-view-note  { color: #8a6508; font-size: 0.88rem; margin: 6px 0 0; }
.hf-view-conditions, .hf-view-list { margin: 4px 0 8px 20px; padding: 0; font-size: 0.92rem; }
.hf-view-conditions li, .hf-view-list li { margin-bottom: 4px; }
.hf-view-notes {
    background: #f7f7f7;
    padding: 10px 14px;
    border-radius: 4px;
    line-height: 1.55;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}
.hf-view-license { display: inline-block; margin-top: 4px; }
.hf-view-license img { max-width: 320px; width: 100%; border-radius: 6px; border: 1px solid var(--tl-border, #e0e0e0); }

/* Dashboard card unread badge */
.dash-card-badge {
    display: inline-block;
    background: var(--tl-red, #b33);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

/* =====================================================================
   Mobile polish for admin pages (≤600px)
   Desktop layout is untouched. Goals here:
     - Wide tables get a horizontal-scroll container instead of blowing
       past the viewport
     - Per-row action button clusters wrap onto multiple lines
     - Auto-complete dropdowns + modals stay within the screen
     - Filter/toolbar bars wrap cleanly
     - Tighter card padding so content has more room
   ===================================================================== */
@media (max-width: 600px) {
    .admin-card { padding: 16px 14px; }

    /* Tables in admin cards: shrink type and let the list wrapper scroll
       horizontally so the user can swipe to see all columns instead of
       having text overflow into the next page. */
    .invites-table,
    .trailmen-table,
    .families-table,
    .members-table,
    .signup-table,
    .registered-adults-table { font-size: 0.8rem; }
    .invites-table th, .invites-table td,
    .trailmen-table th, .trailmen-table td,
    .families-table th, .families-table td,
    .members-table th, .members-table td,
    .signup-table th, .signup-table td,
    .registered-adults-table th, .registered-adults-table td {
        padding: 8px 6px;
    }
    .invites-list,
    .trailmen-list,
    .families-list,
    .members-list,
    .signup-list,
    .registered-adults-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Action-button clusters on table rows: wrap to a second line + smaller
       buttons so they stop forcing horizontal overflow on the row. */
    .row-actions { flex-wrap: wrap; gap: 4px; }
    .row-actions button {
        font-size: 0.72rem;
        padding: 3px 8px;
    }

    /* Recipient autocomplete dropdown — cap width to viewport. */
    .recipient-results,
    .recipient-search {
        max-width: calc(100vw - 32px);
    }

    /* Modals — most are already responsive; the contact modal had no rule
       and the generic action modal can run wide on a 360px phone. */
    .contact-modal-dialog,
    .modal-card,
    .receipt-modal-card,
    .action-modal-dialog {
        max-width: calc(100vw - 24px);
    }

    /* Filter/toolbar bars (broadcast recipients, contact tabs, etc.) wrap
       so they stop pushing controls off-screen. */
    .admin-action-bar,
    .admin-form-row,
    .contact-inbox-tabs {
        flex-wrap: wrap;
    }
    .admin-action-bar > *,
    .contact-inbox-tabs > * { min-width: 0; }

    /* Hub grid (admin.html overview) — single column so cards aren't squashed. */
    .admin-hub-grid {
        grid-template-columns: 1fr;
    }

    /* Edit/Add Member modal can hold a lot of fields — tighten its inner padding
       and allow vertical scroll. */
    .modal-card { padding: 18px 16px; }
}

/* --- Broadcast: saved messages (templates) + test send --- */
.broadcast-templates {
    margin: 4px 0 18px;
    padding: 12px 14px;
    background: var(--gray-100, #f4f4f5);
    border: 1px solid var(--gray-200, #e4e4e7);
    border-radius: 8px;
}
.broadcast-templates-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
}
.broadcast-templates-row,
.broadcast-save-row,
.broadcast-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.broadcast-templates-row select { flex: 1 1 220px; min-width: 0; }
.broadcast-save-row { margin-top: 6px; }
.broadcast-save-row input[type="text"] { flex: 1 1 240px; min-width: 0; }
.test-target-group { margin-top: 14px; }
.broadcast-actions { margin-top: 6px; }
/* Secondary buttons in these rows shouldn't stretch full-width like the primary send button. */
.broadcast-templates-row .btn,
.broadcast-save-row .btn,
.broadcast-actions .btn-secondary { flex: 0 0 auto; width: auto; }

/* --- Cross-page linking polish (trailman ↔ families ↔ people) --- */
.trailman-family-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--gray-300, #cfc8bc);
    text-underline-offset: 3px;
}
.trailman-family-link:hover { text-decoration-color: currentColor; }
.trailman-family-view-all {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 10px;
}
.family-group-highlight {
    outline: 2px solid var(--tl-blue);
    outline-offset: 3px;
    border-radius: var(--radius);
    transition: outline-color 0.6s;
}
.family-group-member a strong { color: var(--tl-blue); }

/* --- Family detail page (admin-family.html) --- */
.family-detail-actions {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--gray-200);
    flex-wrap: wrap;
    align-items: center;
}
.family-detail-list-link {
    font-size: 0.82rem;
    font-weight: 600;
    margin-left: auto;
}
.family-group-title a { color: inherit; }
.family-group-title a:hover { color: var(--tl-blue); }

/* --- Registered Adults: Trail Life Connect sync --- */
.status-declined {
    background: var(--gray-100, #F0EDE6);
    color: var(--gray-500, #8C8578);
}
.tlc-last-sync {
    font-size: 0.8rem;
    color: var(--gray-500);
}
.tlc-chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 5px; }
.tlc-chip {
    display: inline-block;
    background: #FFF1D6;
    color: #876237;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}
.tlc-role-note { color: var(--gray-500); font-size: 0.78rem; }
.status-notinvited {
    background: #DDE9F4;
    color: #004B87;
}
.tlc-id-btn {
    background: none;
    border: 1px dashed var(--gray-200, #DDD8CE);
    border-radius: 10px;
    color: var(--gray-500, #8C8578);
    font-family: var(--font-body);
    font-size: 0.68rem;
    padding: 2px 8px;
    margin-top: 4px;
    cursor: pointer;
}
.tlc-id-btn:hover { border-color: var(--tl-blue, #004B87); color: var(--tl-blue, #004B87); }
.tlc-id-btn.linked { border-style: solid; color: #2D5E2A; border-color: #CDE5CF; }
.fam-remove-member {
    background: none;
    border: 1px dashed var(--gray-200, #DDD8CE);
    border-radius: 10px;
    color: var(--gray-500, #8C8578);
    font-family: var(--font-body);
    font-size: 0.68rem;
    padding: 2px 8px;
    margin-left: 6px;
    cursor: pointer;
}
.fam-remove-member:hover { border-color: var(--crimson, #B3261E); color: var(--crimson, #B3261E); }
.fam-account-badge {
    display: inline-block;
    background: #EAF3EB;
    color: #2D5E2A;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}


/* === Dark mode criticals (audit #57-71 subset, added 2026-08-05) ========== */
[data-theme="dark"] .contact-row-name { color: var(--gray-900); }
[data-theme="dark"] .admin-filter select, [data-theme="dark"] .admin-toolbar select,
[data-theme="dark"] .admin-card select, [data-theme="dark"] .admin-card input[type="text"],
[data-theme="dark"] .admin-card input[type="search"], [data-theme="dark"] .admin-card input[type="date"],
[data-theme="dark"] .admin-card input[type="email"], [data-theme="dark"] .admin-card input[type="tel"],
[data-theme="dark"] .admin-card textarea {
    background: var(--white); color: var(--gray-900); border-color: var(--gray-200);
}
[data-theme="dark"] .tm-count-chip.status-pending { color: #D4A55A; }
[data-theme="dark"] .tm-count-chip.status-accepted { color: #81C784; }
[data-theme="dark"] .recipient-picker input { background: var(--white); color: var(--gray-900); }
[data-theme="dark"] .recipient-result-name { color: var(--gray-900); }
[data-theme="dark"] .recipient-result-meta { color: var(--gray-500); }
[data-theme="dark"] .award-dues-info { background: #35302A; }
[data-theme="dark"] .admin-hub-card-featured { background: #2A2826; }
[data-theme="dark"] .contact-tab.active { color: #7FB069; }
[data-theme="dark"] .hf-view-h3 { color: #7FB069; }
