/**
 * Sub-Community Manager Frontend Styles
 * Inherits site theme styles with minimal overrides
 */

/* Community List Table */
.scm-community-list-wrapper {
    margin: 20px 0;
}

.scm-community-table {
    width: 100%;
    border-collapse: collapse;
}

.scm-community-table th,
.scm-community-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.scm-community-table th {
    font-weight: 600;
    background-color: #f5f5f5;
}

.scm-community-table tbody tr:hover {
    background-color: #fafafa;
}

/* Community Name */
.scm-community-name strong {
    font-size: 1.1em;
}

/* Error Indicator */
.scm-error-indicator {
    margin-left: 5px;
}

/* Pending Badge */
.scm-pending-badge {
    display: inline-block;
    padding: 2px 8px;
    background-color: #ff9800;
    color: #fff;
    border-radius: 10px;
    font-size: 0.85em;
    font-weight: 600;
}

/* Buttons */
.scm-button {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s, color 0.2s;
    cursor: pointer;
    border: none;
}

.scm-button:hover {
    text-decoration: none;
}

.scm-button-small {
    padding: 5px 12px;
    font-size: 13px;
}

/* Primary button - uses theme's primary color or fallback */
.scm-button {
    background-color: #0073aa;
    color: #fff;
}

.scm-button:hover {
    background-color: #005d8c;
    color: #fff;
}

/* Secondary button */
.scm-button-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.scm-button-secondary:hover {
    background-color: #e0e0e0;
    color: #333;
}

/* Actions column */
.scm-actions {
    white-space: nowrap;
}

.scm-actions .scm-button {
    margin-right: 5px;
}

.scm-actions .scm-button:last-child {
    margin-right: 0;
}

/* No communities message */
.scm-no-communities {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .scm-community-table {
        display: block;
        overflow-x: auto;
    }
    
    .scm-community-table th,
    .scm-community-table td {
        padding: 10px;
        font-size: 0.9em;
    }
}

@media screen and (max-width: 480px) {
    .scm-button-small {
        padding: 4px 8px;
        font-size: 0.8em;
    }
}

/* User List Tables (Applicants, Members, etc.) */
.scm-user-list-wrapper {
    margin: 20px 0;
}

.scm-user-table {
    width: 100%;
    border-collapse: collapse;
}

.scm-user-table th,
.scm-user-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.scm-user-table th {
    font-weight: 600;
    background-color: #f5f5f5;
}

.scm-user-table tbody tr:hover {
    background-color: #fafafa;
}

.scm-contact-link {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.scm-contact-link:hover {
    text-decoration: underline;
}

/* Action Buttons */
.scm-user-actions {
    white-space: nowrap;
}

.entry-content .scm-action-btn,
.scm-action-btn {
    display: inline-block;
    padding: 8px 16px;
    margin-right: 5px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    background-color: #f0f0f0 !important;
    color: #333 !important;
}

.entry-content .scm-action-btn:hover,
.scm-action-btn:hover {
    background-color: #e0e0e0 !important;
    color: #333 !important;
}

.scm-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.entry-content .scm-action-btn.scm-action-success,
.scm-action-btn.scm-action-success {
    background-color: #46b450 !important;
    color: #fff !important;
}

.entry-content .scm-action-btn.scm-action-success:hover,
.scm-action-btn.scm-action-success:hover {
    background-color: #3a9a42 !important;
    color: #fff !important;
}

.entry-content .scm-action-btn.scm-action-danger,
.scm-action-btn.scm-action-danger {
    background-color: #dc3545 !important;
    color: #fff !important;
}

.entry-content .scm-action-btn.scm-action-danger:hover,
.scm-action-btn.scm-action-danger:hover {
    background-color: #c82333 !important;
    color: #fff !important;
}

.scm-no-users, .scm-error {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.scm-error {
    color: #dc3545;
}

/* Managers list styles */
.scm-managers-wrapper {
    margin: 20px 0;
}

.scm-role-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.scm-role-admin {
    background: #0073aa;
    color: #fff;
}

.scm-role-manager {
    background: #00a32a;
    color: #fff;
}

.scm-admin-note {
    color: #666;
    font-style: italic;
    font-size: 12px;
}

.scm-action-primary {
    background: #0073aa !important;
    color: #fff !important;
    border-color: #0073aa !important;
}

.scm-action-primary:hover {
    background: #005a87 !important;
}

/* Community settings form */
.scm-community-settings-wrapper {
    margin: 20px 0;
}

.scm-settings-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media screen and (min-width: 768px) {
    .scm-settings-form {
        grid-template-columns: 1fr 1fr;
    }
}

.scm-settings-form .scm-form-row-full {
    grid-column: 1 / -1;
}

.scm-settings-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.scm-settings-form .scm-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.scm-settings-form .scm-description,
p.scm-description {
    color: #666;
    font-size: 13px;
    margin-top: 5px;
    display: block;
    width: 100%;
    margin-bottom: 10px;
}

.scm-settings-form .scm-current-logo {
    margin-top: 10px;
}

.scm-form-actions {
    margin-top: 20px;
    grid-column: 1 / -1;
}

.scm-btn,
.entry-content .scm-btn,
.inside-article .scm-btn {
    padding: 8px 16px !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    display: inline-block !important;
    line-height: 1.4 !important;
    text-decoration: none !important;
}

.entry-content .scm-btn-primary,
.inside-article .scm-btn-primary,
.scm-btn-primary {
    background: #0073aa !important;
    color: #fff !important;
}

.entry-content .scm-btn-primary:hover,
.inside-article .scm-btn-primary:hover,
.scm-btn-primary:hover {
    background: #005a87 !important;
    color: #fff !important;
}

.scm-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: scm-spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes scm-spin {
    to { transform: rotate(360deg); }
}

.scm-message {
    display: inline-block;
    margin-left: 10px;
    padding: 5px 10px;
    border-radius: 3px;
}

.scm-message.scm-success {
    background: #d4edda;
    color: #155724;
}

.scm-message.scm-error {
    background: #f8d7da;
    color: #721c24;
}

/* User status badges */
.scm-user-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.scm-status-admin {
    background-color: #9b59b6;
    color: #fff;
}

.scm-status-manager {
    background-color: #3498db;
    color: #fff;
}

.scm-status-member {
    background-color: #95a5a6;
    color: #fff;
}

/* Logo picker */
.scm-logo-picker {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scm-logo-preview {
    width: 150px;
    height: 150px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    overflow: hidden;
    aspect-ratio: 1;
}

.scm-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scm-no-logo {
    color: #999;
    font-size: 13px;
    text-align: center;
}

.scm-logo-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.scm-btn-link {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0;
    font-size: 13px;
}

.scm-btn-link:hover {
    text-decoration: underline;
}

/* Logo Upload */
.scm-logo-upload-area {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.scm-file-input {
    font-size: 13px;
}

.scm-upload-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: scm-spin 0.6s linear infinite;
}

.scm-upload-message {
    font-size: 13px;
    margin-top: 5px;
}

.scm-upload-message.scm-success {
    color: #46b450;
}

.scm-upload-message.scm-error {
    color: #dc3545;
}

.scm-file-limits {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* Settings Section Separator */
.scm-settings-separator {
    grid-column: 1 / -1;
    border-top: 2px solid #e0e0e0;
    margin: 10px 0 0;
}

.scm-settings-section-title {
    grid-column: 1 / -1;
    font-size: 1.15em;
    margin: 0 0 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

/* Channel Image Picker */
.scm-channel-image-picker {
    margin-top: 8px;
}

.scm-channel-image-preview {
    width: 300px;
    max-width: 100%;
    height: 160px;
    border: 2px dashed #ddd;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    overflow: hidden;
    margin-bottom: 8px;
}

.scm-channel-featured-preview {
    width: 100%;
    max-width: 500px;
    height: 160px;
}

.scm-channel-image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.scm-no-image {
    color: #999;
    font-size: 13px;
    text-align: center;
}

.scm-channel-image-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.scm-textarea {
    width: 100%;
    min-height: 80px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

/* User Details Modal */
.scm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.scm-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.scm-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    z-index: 1;
}

.scm-modal-close:hover {
    color: #333;
}

.scm-modal-body {
    padding-top: 10px;
    overflow-y: auto;
    flex: 1;
}

.scm-user-details h3 {
    margin: 0 0 15px 0;
    font-size: 1.4em;
    color: #333;
}

.scm-user-details p {
    margin: 8px 0;
    color: #555;
}

.scm-user-details .scm-user-email {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.scm-custom-fields {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    max-height: 400px;
    overflow-y: auto;
}

.scm-custom-fields p {
    margin: 5px 0;
}

/* Custom field value styling */
.scm-field-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.scm-field-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.scm-field-label {
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 4px;
}

.scm-field-value {
    display: block;
    color: #555;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.scm-field-value.scm-long-text {
    max-height: 150px;
    overflow-y: auto;
    padding: 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    white-space: pre-wrap;
}

.scm-field-value a {
    color: #0073aa;
    text-decoration: none;
    word-break: break-all;
}

.scm-field-value a:hover {
    text-decoration: underline;
}

.scm-loading {
    text-align: center;
    padding: 30px;
    color: #666;
}

.scm-loading .scm-spinner {
    margin-right: 10px;
}

/* Navigation Buttons */
.scm-nav-buttons {
    margin-bottom: 20px;
}

.scm-nav-buttons .scm-button {
    display: inline-block;
}

.scm-nav-buttons-bottom {
    margin-top: 30px;
    margin-bottom: 0;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Event Admin Header */
.scm-event-admin-header {
    margin-bottom: 20px;
}

.scm-event-admin-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* App Connection Info Box */
.scm-app-connection-box {
    background: #f0f6fc;
    border: 1px solid #c3d4e0;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.scm-app-connection-header {
    cursor: pointer;
}

.scm-app-connection-header h3 {
    margin: 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.scm-app-connection-header .description {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: #666;
}

.scm-app-toggle-icon {
    margin-left: auto;
}

.scm-app-connection-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #c3d4e0;
}

.scm-app-qr-code img {
    max-width: 200px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.scm-app-detail {
    margin-top: 8px;
}

.scm-app-detail code {
    background: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    user-select: all;
    font-size: 13px;
}

.scm-app-store-links {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #c3d4e0;
}

.scm-app-store-links strong {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
}

.scm-app-store-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.scm-app-store-badge {
    display: inline-block;
    text-decoration: none;
    border-radius: 5px;
    transition: opacity 0.2s ease;
}

.scm-app-store-badge:hover {
    opacity: 0.85;
}

.scm-app-store-badge svg {
    display: block;
}

.scm-button-primary {
    background-color: #0073aa;
    color: #fff;
}

.scm-button-primary:hover {
    background-color: #005d8c;
    color: #fff;
}

/* Events Styles */
.scm-events-wrapper {
    margin: 20px 0;
}

/* Events list — 2-column row layout (info left, image right) */
.scm-events-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.scm-event-row {
    display: flex;
    gap: 24px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.scm-event-row:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.scm-event-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.scm-event-row .scm-event-image {
    flex: 0 0 40%;
    max-width: 40%;
}

.scm-event-row .scm-event-image img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.scm-event-title {
    margin: 0 0 8px 0;
    font-size: 1.25em;
    line-height: 1.3;
}

.scm-event-title a {
    color: #333;
    text-decoration: none;
}

.scm-event-title a:hover {
    color: var(--scm-primary-color, #0073aa);
}

.scm-event-date {
    color: #555;
    font-size: 0.9em;
    margin-bottom: 4px;
}

.scm-event-date::before {
    content: "\1F4C5 ";
}

.scm-event-venue {
    color: #555;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.scm-event-venue::before {
    content: "\1F4CD ";
}

.scm-event-details-link {
    font-size: 0.9em;
    color: var(--scm-link-color, var(--scm-primary-color, #0073aa));
    text-decoration: none;
    margin-bottom: 12px;
}

.scm-event-details-link:hover {
    text-decoration: underline;
}

/* Event button container: host info left, button right, wraps + centres when tight */
.scm-event-button-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    padding-top: 12px;
    gap: 12px 16px;
}
/* Host info grows to push button right when on same line; min-width forces wrap when tight */
.scm-event-button-container .scm-event-host-info {
    flex: 1 1 auto;
    min-width: 60%;
}

.scm-event-host-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scm-event-host-logo-link {
    flex-shrink: 0;
    line-height: 0;
}
.scm-event-host-logo {
    object-fit: contain;
    flex-shrink: 0;
}

.scm-event-host-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.scm-event-hosted-by {
    color: inherit;
    opacity: 0.7;
}

.scm-event-host-name {
    font-weight: 600;
}

.scm-event-btn-styled {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.scm-event-btn-going {
    opacity: 0.85;
}

.scm-no-events {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.scm-notice {
    padding: 15px;
    background: #f0f6fc;
    border-left: 4px solid #0073aa;
    color: #333;
}

/* Event Admin Styles */
.scm-event-admin-wrapper {
    margin: 20px 0;
}

.scm-event-admin-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.scm-event-admin-info p {
    margin: 5px 0;
}

.scm-events-table {
    margin-top: 15px;
}

.scm-event-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.scm-status-publish {
    background: #d4edda;
    color: #155724;
}

.scm-status-draft {
    background: #fff3cd;
    color: #856404;
}

.scm-status-pending {
    background: #cce5ff;
    color: #004085;
}

.scm-status-private {
    background: #f8d7da;
    color: #721c24;
}

/* Sortable Table Headers */
.scm-sortable-table th.scm-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.scm-sortable-table th.scm-sortable:hover {
    background-color: #e8e8e8;
}

.scm-sort-icon {
    font-size: 11px;
    opacity: 0.4;
    margin-left: 4px;
}

.scm-sortable-table th.scm-sortable.scm-sort-asc .scm-sort-icon,
.scm-sortable-table th.scm-sortable.scm-sort-desc .scm-sort-icon {
    opacity: 1;
}

.scm-sortable-table th.scm-sortable.scm-sort-asc .scm-sort-icon::after {
    content: '↑';
}

.scm-sortable-table th.scm-sortable.scm-sort-desc .scm-sort-icon::after {
    content: '↓';
}

.scm-sortable-table th.scm-sortable.scm-sort-asc .scm-sort-icon,
.scm-sortable-table th.scm-sortable.scm-sort-desc .scm-sort-icon {
    font-size: 0;
}

/* Past Events */
.scm-past-events-separator td {
    padding: 12px 15px !important;
    background: transparent !important;
    border-bottom: 2px solid #ccc;
    border-top: 1px solid #e0e0e0;
    font-weight: 600;
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scm-past-event {
    opacity: 0.6;
}

.scm-past-event:hover {
    opacity: 0.85;
}

/* Past Events */
.scm-past-events-heading {
    margin-top: 32px;
    margin-bottom: 16px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    font-size: 1.3em;
    font-weight: 600;
    color: #555;
}

.scm-event-past {
    opacity: 0.75;
}

.scm-event-past:hover {
    opacity: 1;
}

/* Responsive Events — stacked mode (JS-driven, based on image vs info height ratio) */
.scm-event-row-stacked {
    flex-direction: column;
}
.scm-event-row-stacked .scm-event-image {
    flex: none;
    max-width: 100%;
    order: -1;
}

/* Event Summary Modal */
.scm-event-summary-modal-content {
    max-width: 900px !important;
    width: 95%;
}

.scm-event-summary-modal-content .scm-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.scm-event-summary-modal-content .scm-modal-header h3 {
    margin: 0;
    flex: 1;
}

.scm-event-summary-view-toggle {
    display: flex;
    gap: 4px;
}

.scm-summary-toggle {
    padding: 4px 12px !important;
    font-size: 12px !important;
    border-radius: 3px !important;
}

.scm-summary-toggle.active {
    background: #0073aa !important;
    color: #fff !important;
}

.scm-event-summary-modal-content .scm-events-list {
    padding: 0;
}

.scm-event-summary-modal-content .scm-event-row {
    margin-bottom: 0;
}

.scm-event-summary-row.scm-summary-stacked {
    flex-direction: column;
}

.scm-event-summary-row.scm-summary-stacked .scm-event-image {
    flex: none;
    max-width: 100%;
    order: -1;
}

/* ================================
   Email Contacts Shortcode
   ================================ */

.scm-email-contacts-wrapper {
    max-width: 700px;
    margin: 20px 0;
}

.scm-email-toggles {
    margin-bottom: 20px;
}

.scm-email-toggles h3 {
    margin-bottom: 8px;
}

.scm-email-toggles .description {
    margin-bottom: 12px;
    color: #666;
    font-size: 0.9em;
}

.scm-email-toggle {
    display: inline-flex;
    align-items: center;
    margin-right: 20px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 1em;
}

.scm-email-toggle input[type="checkbox"] {
    margin-right: 6px;
}

.scm-email-actions {
    margin-bottom: 20px;
}

.scm-generate-emails-btn {
    padding: 8px 20px !important;
    font-size: 14px !important;
}

.scm-email-results {
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.scm-email-count {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.scm-email-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    resize: vertical;
    box-sizing: border-box;
}

.scm-email-copy-actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.scm-copy-emails-btn {
    padding: 6px 16px !important;
}

.scm-copy-feedback {
    color: #46b450;
    font-weight: 600;
    font-size: 0.9em;
}

.scm-email-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: #666;
}

.scm-email-loading .spinner {
    float: none;
    margin: 0;
}

.scm-email-error {
    margin-top: 10px;
    padding: 10px 15px;
    background: #fef7f1;
    border-left: 4px solid #d63638;
    color: #8b3a3a;
    border-radius: 0 3px 3px 0;
}

.scm-create-email-btn {
    padding: 6px 16px !important;
}

/* ===== Email Compose Popup ===== */

.scm-email-compose-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scm-email-compose-popup {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.scm-email-compose-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f9f9f9;
}

.scm-email-compose-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.scm-email-compose-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #666;
    padding: 0 4px;
    line-height: 1;
}

.scm-email-compose-close:hover {
    color: #333;
}

.scm-email-compose-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.scm-email-compose-field {
    margin-bottom: 16px;
}

.scm-email-compose-field:last-child {
    margin-bottom: 0;
}

.scm-email-compose-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
    color: #333;
}

.scm-email-compose-to {
    width: 100%;
    padding: 8px 10px;
    font-family: monospace;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    box-sizing: border-box;
}

.scm-email-compose-subject {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.scm-email-compose-body-input {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    box-sizing: border-box;
    min-height: 120px;
}

.scm-email-compose-note {
    margin: 6px 0 0;
    font-size: 12px;
    color: #888;
    font-style: italic;
}

.scm-email-compose-actions {
    padding: 14px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f9f9f9;
}

@media screen and (max-width: 600px) {
    .scm-email-toggle {
        display: flex;
        margin-right: 0;
    }

    .scm-email-compose-popup {
        width: 95%;
        max-height: 95vh;
    }

    .scm-email-copy-actions {
        flex-wrap: wrap;
    }
}

/* ===== Feature Toggles ===== */

.scm-feature-toggles-wrapper {
    margin: 20px 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media screen and (min-width: 768px) {
    .scm-feature-toggles-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

.scm-feature-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 16px 20px;
    background: #fff;
}

.scm-feature-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.scm-feature-name {
    font-weight: 600;
    font-size: 15px;
    color: #1d2327;
}

.scm-feature-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scm-feature-status.enabled {
    background: #d4edda;
    color: #155724;
}

.scm-feature-status.disabled {
    background: #f8d7da;
    color: #721c24;
}

.scm-feature-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scm-feature-link a {
    color: #0073aa;
    text-decoration: none;
    font-size: 13px;
}

.scm-feature-link a:hover {
    color: #005a87;
    text-decoration: underline;
}

.scm-feature-setting {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    flex-wrap: wrap;
}

.scm-feature-setting label {
    font-weight: 500;
    color: #50575e;
    white-space: nowrap;
}

.scm-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.scm-checkbox-label input[type="checkbox"] {
    margin: 0;
}

.scm-events-also-members .scm-description {
    width: 100%;
    margin-top: 0;
}

.scm-feature-setting-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
}

.scm-setting-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: scm-spin 1s linear infinite;
}

.scm-feature-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.entry-content .scm-btn-danger,
.scm-btn-danger {
    background: #dc3545 !important;
    color: #fff !important;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.entry-content .scm-btn-danger:hover,
.scm-btn-danger:hover {
    background: #c82333 !important;
    color: #fff !important;
}

.scm-btn-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.entry-content .scm-btn-success,
.scm-btn-success {
    background: #28a745 !important;
    color: #fff !important;
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.entry-content .scm-btn-success:hover,
.scm-btn-success:hover {
    background: #218838 !important;
    color: #fff !important;
}

.scm-btn-success:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media screen and (max-width: 600px) {
    .scm-feature-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .scm-feature-setting {
        flex-direction: column;
        align-items: flex-start;
    }

    .scm-feature-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================================================================
   Community Styling Form
   ========================================================================= */

.scm-community-styling-wrapper {
    margin: 20px 0;
}

.scm-styling-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0 1rem;
}

.scm-styling-form .scm-form-row {
    margin-bottom: 16px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.scm-styling-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Prevent any input/select from overflowing its grid cell */
.scm-styling-form input[type="text"],
.scm-styling-form input[type="number"],
.scm-styling-form select,
.scm-styling-form textarea {
    max-width: 100%;
    box-sizing: border-box;
    font-size: 11px;
}

.scm-styling-section-title {
    font-size: 14px;
    font-weight: 600;
    margin: 24px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.scm-styling-section-title:first-of-type {
    margin-top: 10px;
}

/* Styling form section dividers */
.scm-styling-section {
    border-top: 2px solid #e0e0e0;
    padding-top: 10px;
    margin-top: 10px;
}

.scm-styling-section:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.scm-section-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 0;
}

/* Menu preview in styling form */
.scm-menu-preview {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px dashed #ddd;
    align-items: center;
    flex-wrap: wrap;
}

.scm-menu-preview a {
    padding: 4px 8px;
    border-radius: 3px;
    text-decoration: none;
    color: var(--scm-link-color, #0073aa);
    transition: background-color 0.2s;
}

/* Page nav transition support */
.scm-page-nav a {
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none !important;
}

/* Colour picker row */
.scm-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.scm-color-input {
    width: 44px;
    height: 30px;
    padding: 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background: none;
}

.scm-color-input::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.scm-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

.scm-color-input::-moz-color-swatch {
    border: none;
    border-radius: 2px;
}

.scm-color-hex {
    font-family: monospace;
    font-size: 11px;
    color: #666;
    min-width: 55px;
}

/* Font select */
.scm-font-select {
    width: 100%;
    max-width: 100%;
    font-size: 11px;
    box-sizing: border-box;
}

/* Number input (content width) */
.scm-number-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.scm-number-input {
    width: 60px;
    max-width: 100%;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 11px;
    text-align: center;
    -moz-appearance: textfield;
    box-sizing: border-box;
}

.scm-number-input::-webkit-outer-spin-button,
.scm-number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.scm-number-suffix {
    font-weight: 600;
    font-size: 11px;
    color: #666;
}

/* Live Preview box */
.scm-style-preview {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    background-color: var(--scm-bg-color, #ffffff);
    transition: background-color 0.2s ease;
}

.scm-preview-heading {
    margin: 0 0 12px 0;
    font-size: 24px;
    transition: color 0.2s ease, font-family 0.2s ease;
}

.scm-preview-text {
    margin: 0 0 12px 0;
    font-size: 15px;
    line-height: 1.6;
    transition: color 0.2s ease, font-family 0.2s ease;
}

.scm-preview-link {
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.scm-preview-link:hover {
    color: var(--scm-secondary-color, #005a87) !important;
}

.scm-preview-button {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    color: var(--scm-button-text-color, #ffffff) !important;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.scm-preview-button:hover {
    background-color: var(--scm-secondary-color, #005a87) !important;
}

/* Apply Button preview */
.scm-apply-btn-preview-container {
    display: flex;
    gap: 16px;
    border: 1px dashed #ddd;
    transition: background-color 0.2s ease;
}

.scm-apply-btn-preview-container.scm-preview-justify-center {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.scm-apply-btn-preview-container.scm-preview-justify-left {
    flex-direction: row;
    align-items: center;
}

.scm-apply-btn-preview-container.scm-preview-justify-left .scm-apply-btn-preview {
    order: -1;
}

.scm-apply-btn-preview-container.scm-preview-justify-right {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
}

.scm-apply-btn-preview-text {
    flex: 1;
    transition: all 0.2s ease;
}

.scm-apply-btn-preview {
    display: inline-block;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* Apply Button form controls */
.scm-padding-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.scm-padding-row .scm-number-input {
    width: 50px;
}

.scm-padding-row label {
    font-weight: 400 !important;
    font-size: 11px;
    color: #666;
    margin-bottom: 0 !important;
}

.scm-color-default-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 400 !important;
    font-size: 11px;
    color: #666;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.scm-color-default-toggle input[type="checkbox"] {
    margin: 0;
}

.scm-conditional-color:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.scm-weight-select {
    width: 100%;
    max-width: 100%;
    font-size: 11px;
    box-sizing: border-box;
}

/* Secondary button — styled like primary (blue) */
.entry-content .scm-btn-secondary,
.scm-btn-secondary {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    background: #0073aa !important;
    color: #fff !important;
    margin-left: 10px;
}

.entry-content .scm-btn-secondary:hover,
.scm-btn-secondary:hover {
    background: #005a87 !important;
    color: #fff !important;
}

/* ==========================================
   Page Content Editor
   ========================================== */

.scm-page-content {
    margin-bottom: 1em;
}

.scm-content-editor-wrapper {
    margin: 20px 0;
}

.scm-content-editor-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 2px solid #ddd;
    margin-bottom: 0;
}

/* Tab styles — use .entry-content prefix + !important to override community_styles_shortcode
   which sets .entry-content button { background-color: var(--scm-primary-color); color: #fff; }
   Uses community background-color for tab backgrounds and heading-color for tab text */
.entry-content .scm-content-editor-tab,
.scm-content-editor-tab {
    padding: 12px 20px;
    cursor: pointer;
    background: var(--scm-background-color, #f7f7f7) !important;
    border: 1px solid #ddd !important;
    border-bottom: 3px solid transparent !important;
    font-size: 14px;
    font-weight: 500;
    color: var(--scm-heading-color, #1d2327) !important;
    transition: all 0.2s ease;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.entry-content .scm-content-editor-tab:hover,
.scm-content-editor-tab:hover {
    color: var(--scm-heading-color, #1d2327) !important;
    background: var(--scm-background-color, #e9e9e9) !important;
    filter: brightness(0.95);
}

.entry-content .scm-content-editor-tab.active,
.scm-content-editor-tab.active {
    color: var(--scm-background-color, #fff) !important;
    background: var(--scm-heading-color, #1d2327) !important;
    border-color: var(--scm-heading-color, #1d2327) !important;
    border-bottom-color: var(--scm-heading-color, #1d2327) !important;
    border-radius: 4px 4px 0 0;
    font-weight: 600;
}

.entry-content .scm-content-editor-tab.active:hover,
.scm-content-editor-tab.active:hover {
    color: var(--scm-background-color, #fff) !important;
    background: var(--scm-heading-color, #555) !important;
    filter: brightness(1.3);
}

/* Disabled badge (icon) in tabs — uses background-color for bg, heading-color for text */
.scm-disabled-badge {
    display: inline-block;
    background: var(--scm-background-color, #f0f0f0);
    color: var(--scm-heading-color, #1d2327);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid var(--scm-heading-color, #ddd);
}

.scm-content-editor-panel {
    display: none;
    padding: 20px 0;
}

.scm-content-editor-panel.active {
    display: block;
}

.scm-disabled-notice {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #50575e;
    border-radius: 0 4px 4px 0;
}

.scm-editor-actions {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.scm-save-page-content {
    padding: 8px 20px;
    font-size: 14px;
}

.scm-save-page-content.scm-unsaved {
    box-shadow: 0 0 0 2px #d63638;
    animation: scm-pulse 2s ease-in-out 1;
}

@keyframes scm-pulse {
    0%, 100% { box-shadow: 0 0 0 2px #d63638; }
    50% { box-shadow: 0 0 0 4px rgba(214, 54, 56, 0.4); }
}

.scm-save-feedback {
    display: none;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 4px;
}

.scm-save-feedback.scm-success {
    color: #00a32a;
    background: #edfaef;
}

.scm-save-feedback.scm-error {
    color: #d63638;
    background: #fcf0f1;
}

/* ==========================================
   Member Count
   ========================================== */

.scm-member-count {
    text-align: center;
    font-size: 1.1em;
    color: #1d2327;
    margin: 10px 0 20px;
}

.scm-member-count-number {
    font-weight: 700;
    font-size: 1.3em;
    color: #0073aa;
}

.scm-pending-count {
    color: #d63638;
    font-weight: 600;
    font-size: 0.9em;
}

/* ==========================================
   Member Directory
   ========================================== */

.scm-directory-wrapper {
    margin: 20px auto;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.scm-directory-heading {
    margin: 0 0 16px 0;
    font-size: 1.3em;
    font-weight: 600;
    color: #555;
}

/* Controls: search + filter row */
.scm-directory-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.scm-directory-search {
    flex: 1;
    min-width: 200px;
}

.scm-directory-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.scm-directory-search-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.scm-directory-filters {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* Filter buttons — override community styles .entry-content button rules */
.entry-content .scm-directory-filter-btn,
.scm-directory-filter-btn {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f7f7f7 !important;
    color: #555 !important;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.entry-content .scm-directory-filter-btn:hover,
.scm-directory-filter-btn:hover {
    background: #e9e9e9 !important;
    border-color: #ccc;
    color: #333 !important;
}

.entry-content .scm-directory-filter-btn.active,
.scm-directory-filter-btn.active {
    background: var(--scm-primary-color, #0073aa) !important;
    color: #fff !important;
    border-color: var(--scm-primary-color, #0073aa);
}

/* Results Count */
.scm-directory-results-count {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

/* Directory Table */
.scm-directory-table {
    width: 100% !important;
    min-width: 100% !important;
    table-layout: auto;
    border-collapse: collapse;
    box-sizing: border-box;
}

.scm-directory-table th,
.scm-directory-table td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.scm-directory-table th {
    font-weight: 600;
    background-color: #f5f5f5;
    font-size: 14px;
    user-select: none;
}

.scm-directory-table th[data-sortable] {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.scm-directory-table th[data-sortable]:hover {
    background-color: #e8e8e8;
}

.scm-sort-indicator {
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.3;
    display: inline-block;
}

.scm-directory-table th.sorted .scm-sort-indicator {
    opacity: 1;
    color: #0073aa;
}

.scm-directory-table th.sorted[data-sort-dir="desc"] .scm-sort-indicator {
    transform: rotate(180deg);
}

.scm-directory-table tbody tr {
    transition: background-color 0.15s ease;
}

.scm-directory-table tbody tr:hover {
    background-color: #fafafa;
}

.scm-directory-table tbody tr.scm-hidden {
    display: none;
}

/* Member name links */
.scm-directory-member-link {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.scm-directory-member-link:hover {
    text-decoration: underline;
    color: #005a87;
}

/* Message / Profile column — narrow, icon centred */
.scm-directory-profile-col {
    width: 60px;
    text-align: center;
}
td.scm-directory-profile-col {
    text-align: center !important;
}
td.scm-directory-profile-col .scm-directory-message-link {
    margin: 0 auto;
}

/* Role column — compact */
.scm-directory-role-col {
    width: 90px;
}

.scm-directory-profile-link,
.entry-content .scm-directory-profile-link,
.scm-directory-wrapper .scm-directory-profile-link {
    display: inline-block;
    padding: 4px 12px;
    background: #0073aa;
    color: #fff !important;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.2s;
    line-height: 1.4;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.entry-content .scm-directory-profile-link:hover,
.scm-directory-wrapper .scm-directory-profile-link:hover,
.scm-directory-profile-link:hover {
    background: #005a87;
    text-decoration: none !important;
    color: #fff !important;
}

.scm-directory-message-link,
.entry-content .scm-directory-message-link,
.scm-directory-wrapper .scm-directory-message-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #0073aa;
    color: #fff !important;
    border-radius: 50%;
    text-decoration: none !important;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.entry-content .scm-directory-message-link:hover,
.scm-directory-wrapper .scm-directory-message-link:hover,
.scm-directory-message-link:hover {
    background: #005a87;
    text-decoration: none !important;
    color: #fff !important;
}

.scm-directory-message-link svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
    flex-shrink: 0;
}

/* Role badges */
.scm-role-badge-admin {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    background: #9b59b6;
    color: #fff;
}

.scm-role-badge-manager {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    background: #3498db;
    color: #fff;
}

.scm-role-badge-member {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    background: #95a5a6;
    color: #fff;
}

/* No Results Message */
.scm-directory-no-results {
    text-align: center;
    padding: 30px 20px;
    color: #666;
    font-style: italic;
    font-size: 14px;
}

/* Directory Popup (no-space mode) */
.scm-directory-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.scm-directory-popup {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.scm-directory-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    z-index: 1;
}

.scm-directory-popup-close:hover {
    color: #333;
}

.scm-directory-popup-body {
    overflow-y: auto;
    flex: 1;
}

.scm-directory-popup-body h3 {
    margin: 0 0 8px 0;
    font-size: 1.3em;
    color: #333;
}

.scm-directory-popup-body .scm-directory-popup-role {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

/* Directory Responsive */
@media screen and (max-width: 600px) {
    .scm-directory-wrapper {
        width: 100% !important;
        max-width: 100% !important;
    }

    .scm-directory-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .scm-directory-search {
        min-width: auto;
    }

    .scm-directory-filters {
        justify-content: flex-start;
    }

    .scm-directory-table th,
    .scm-directory-table td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .scm-directory-popup {
        padding: 20px;
        width: 95%;
    }
}

/* ==========================================
   Community Showcase Carousel
   ========================================== */

.scm-showcase-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* The track holds all cards in a row — scrolls horizontally */
.scm-showcase-track {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
    min-height: 200px;
    transition: none;
    /* When items fit: centred.  When carousel is active: JS overrides justify-content */
}

/* When carousel is active the track becomes a smooth-scrolling strip */
.scm-showcase-wrapper.scm-carousel-active .scm-showcase-track {
    justify-content: flex-start;
    flex-wrap: nowrap;
    transition: transform 0.8s ease-in-out;
    will-change: transform;
}

/* Individual community card */
.scm-showcase-card {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: inherit;
    padding: 16px;
    box-sizing: border-box;
    border-radius: 12px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
}

.entry-content .scm-showcase-card,
.scm-showcase-card {
    color: var(--scm-heading-color, #1d2327) !important;
}

.scm-showcase-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.entry-content .scm-showcase-card:hover {
    color: var(--scm-primary-color, #0073aa) !important;
}

/* Logo container */
.scm-showcase-logo {
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 50%;
    overflow: hidden;
    background: #f7f7f7;
    flex-shrink: 0;
}

.scm-showcase-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Placeholder initial when no logo */
.scm-showcase-no-logo {
    background: var(--scm-primary-color, #0073aa);
}

.scm-showcase-initial {
    font-size: 48px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    line-height: 1;
}

/* Community name */
.scm-showcase-name {
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    word-break: break-word;
    max-width: 100%;
}

/* Empty state */
.scm-showcase-empty {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
}

/* Responsive: on small screens, cards shrink */
@media screen and (max-width: 600px) {
    .scm-showcase-logo {
        width: 100px;
        height: 100px;
    }

    .scm-showcase-initial {
        font-size: 32px;
    }

    .scm-showcase-name {
        font-size: 13px;
    }

    .scm-showcase-card {
        padding: 10px;
        max-width: 200px;
    }
}

/* ─── Cancel Membership ─── */
.scm-cancel-membership-wrapper {
    text-align: center;
    margin: 30px 0;
    padding: 20px 0;
}

.scm-admin-warning {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 10px 15px;
    margin-top: 10px;
    display: inline-block;
    font-size: 14px;
}

/* ─── Global Terms Content ─── */
.scm-global-terms-content {
    margin: 20px 0;
}

/* ─── Frontend Log Shortcode Styles ─── */
.scm-frontend-log {
    margin: 30px 0;
}

.scm-frontend-log .scm-log-entries {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px 16px;
    background: #fafafa;
}

.scm-frontend-log .scm-log-entry {
    padding: 6px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

.scm-frontend-log .scm-log-entry:last-child {
    border-bottom: none;
}

.scm-frontend-log .scm-log-date {
    color: #888;
    margin-right: 6px;
}

.scm-frontend-log .scm-log-superseded {
    opacity: 0.65;
}

.scm-frontend-log .scm-superseded-info {
    color: #996800;
    font-style: italic;
    font-size: 0.85em;
}

/* ─── Frontend Event Form ─── */
.scm-event-form-wrapper {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 24px;
    margin: 20px 0;
}

.scm-event-form-wrapper h3 {
    margin-top: 0;
    margin-bottom: 4px;
}

.scm-event-form .scm-form-row {
    margin-bottom: 16px;
}

.scm-event-form .scm-form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.95em;
}

.scm-event-form .scm-form-row label .required {
    color: #d63638;
}

.scm-event-form input[type="text"],
.scm-event-form input[type="date"],
.scm-event-form input[type="time"],
.scm-event-form textarea,
.scm-event-form select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
    box-sizing: border-box;
}

.scm-event-form textarea {
    resize: vertical;
}

.scm-event-form .scm-form-row-inline {
    display: flex;
    gap: 16px;
}

.scm-event-form .scm-form-col {
    flex: 1;
}

.scm-venue-select-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.scm-venue-select-row select {
    flex: 1;
}

.scm-new-venue-fields {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
}

.scm-event-form .scm-form-actions {
    display: flex;
    gap: 10px;
    padding-top: 8px;
    flex-wrap: wrap;
}

.scm-event-form-feedback {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 0.95em;
}

.scm-event-form-feedback.scm-success {
    background: #d5f5d5;
    color: #1a7a1a;
    border: 1px solid #b3e6b3;
}

.scm-event-form-feedback.scm-error {
    background: #fcf0f1;
    color: #8a2424;
    border: 1px solid #f0c0c0;
}

/* Event URL input */
.scm-event-form input[type="url"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
    box-sizing: border-box;
}

/* Tag Checkbox Picker */
.scm-event-tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.scm-tag-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #fff;
    user-select: none;
}

.scm-tag-checkbox:hover {
    background: #f0f6fc;
    border-color: #0073aa;
}

.scm-tag-checkbox input[type="checkbox"] {
    margin: 0;
    width: auto;
    cursor: pointer;
}

.scm-tag-checkbox input[type="checkbox"]:checked + * {
    /* No extra styling needed; the parent hover provides feedback */
}

/* Featured Image Upload */
.scm-event-image-upload {
    margin-top: 6px;
}

.scm-event-image-upload input[type="file"] {
    font-size: 0.9em;
    padding: 4px 0;
}

.scm-event-image-preview {
    margin-top: 10px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.scm-event-image-preview img {
    border: 1px solid #ddd;
    background: #fafafa;
}

/* Warning Button Style (for Recall) */
.entry-content .scm-btn-warning,
.scm-btn-warning {
    background: #ffc107 !important;
    color: #333 !important;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: background-color 0.2s;
}

.entry-content .scm-btn-warning:hover,
.scm-btn-warning:hover {
    background: #e0a800 !important;
    color: #333 !important;
}

.scm-btn-warning:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Event Actions Column */
.scm-event-actions {
    white-space: nowrap;
}

.scm-event-actions .scm-action-btn {
    margin-right: 4px;
    margin-bottom: 4px;
}

.scm-event-actions .scm-action-btn:last-child {
    margin-right: 0;
}

/* Event status badges */
.scm-event-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 600;
}

.scm-status-publish {
    background: #d5f5d5;
    color: #1a7a1a;
}

.scm-status-draft {
    background: #fcf9e8;
    color: #996800;
}

.scm-status-pending {
    background: #e8f0fc;
    color: #1e4d8a;
}

/* ─── Frontend Event Log ─── */
.scm-frontend-event-log {
    margin: 30px 0;
}

.scm-frontend-event-log .scm-log-entries {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px 16px;
    background: #fafafa;
}

.scm-frontend-event-log .scm-log-entry {
    padding: 6px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

.scm-frontend-event-log .scm-log-entry:last-child {
    border-bottom: none;
}

.scm-frontend-event-log .scm-log-date {
    color: #888;
    margin-right: 6px;
}

.scm-frontend-event-log .scm-log-action {
    font-weight: 600;
}

/* Responsive */
@media (max-width: 600px) {
    .scm-event-form .scm-form-row-inline {
        flex-direction: column;
        gap: 0;
    }
    .scm-venue-select-row {
        flex-direction: column;
        align-items: stretch;
    }
    .scm-event-tags-wrapper {
        gap: 6px;
    }
    .scm-tag-checkbox {
        padding: 4px 10px;
        font-size: 0.85em;
    }
    .scm-event-actions {
        white-space: normal;
    }
    .scm-event-form .scm-form-actions {
        flex-direction: column;
    }
}

/* =========================================
   Ticket Management
   ========================================= */

.scm-ticket-management-row td {
    padding: 0 !important;
    border-top: none !important;
}

.scm-ticket-management {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 2px solid #e2e8f0;
}

.scm-ticket-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 10px 15px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
}

.scm-ticket-stat strong {
    font-weight: 600;
}

.scm-ticket-approved strong { color: #16a34a; }
.scm-ticket-pending strong { color: #d97706; }
.scm-ticket-rejected strong { color: #dc2626; }
.scm-ticket-checkedin strong { color: #2563eb; }
.scm-ticket-remaining strong { color: #6b7280; }

.scm-ticket-divider {
    color: #d1d5db;
    font-weight: 300;
}

/* Attendee table */
.scm-attendee-table {
    margin-bottom: 15px;
}

.scm-attendee-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
}

.scm-ticket-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.scm-ticket-status-approved {
    background: #dcfce7;
    color: #166534;
}

.scm-ticket-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.scm-ticket-status-rejected {
    background: #fecaca;
    color: #991b1b;
}

.scm-attendee-actions .scm-action-btn {
    margin-right: 4px;
    padding: 3px 10px;
    font-size: 12px;
}

/* Check-in toggle */
.scm-checkin-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.scm-checkin-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2563eb;
}

.scm-checkin-label {
    font-size: 12px;
    color: #6b7280;
}

.scm-checkin-checkbox:checked + .scm-checkin-label {
    color: #2563eb;
    font-weight: 600;
}

/* Check-in status labels (non-interactive mode) */
.scm-checkin-status-label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}
.scm-checkin-status-label.scm-checkin-attended {
    background-color: #d4edda;
    color: #155724;
}
.scm-checkin-status-label.scm-checkin-pending {
    background-color: #fff3cd;
    color: #856404;
}

/* Ticket action buttons row */
.scm-ticket-actions {
    display: flex;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.scm-text-muted {
    color: #9ca3af;
    font-style: italic;
}

.scm-no-attendees {
    text-align: center;
    color: #9ca3af;
    padding: 20px;
    font-style: italic;
}

/* Ticket count in main table */
.scm-ticket-count-link {
    cursor: pointer;
    color: #2563eb;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.scm-ticket-count-link:hover {
    color: #1d4ed8;
}

.scm-ticket-capacity-draft {
    color: #9ca3af;
}

/* Check-in Mode */
.scm-checkin-mode .scm-checkin-checkbox {
    width: 24px;
    height: 24px;
}

.scm-checkin-mode .scm-checkin-label {
    font-size: 14px;
}

.scm-checkin-mode .scm-attendee-table td {
    padding: 10px 12px;
}

/* Ticket approval description */
.scm-ticket-approval-desc {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 600px) {
    .scm-ticket-summary-bar {
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
    }

    .scm-ticket-divider {
        display: none;
    }

    .scm-ticket-actions {
        flex-direction: column;
    }

    .scm-checkin-mode .scm-checkin-checkbox {
        width: 30px;
        height: 30px;
    }

    .scm-checkin-mode .scm-checkin-label {
        font-size: 16px;
    }
}

/* ─── User Guide ─── */
.scm-user-guide {
    max-width: 900px;
    margin: 30px auto;
    font-size: 15px;
    line-height: 1.6;
}

.scm-guide-title {
    font-size: 1.6em;
    margin-bottom: 10px;
}

.scm-guide-intro {
    color: #555;
    margin-bottom: 20px;
}

/* Table of Contents */
.scm-guide-toc {
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px 24px;
    margin-bottom: 30px;
}

.scm-guide-toc h3 {
    margin-top: 0;
    font-size: 1.1em;
}

.scm-guide-toc ol {
    margin: 0;
    padding-left: 20px;
    columns: 2;
    column-gap: 30px;
}

.scm-guide-toc li {
    padding: 3px 0;
    break-inside: avoid;
}

.scm-guide-toc a {
    text-decoration: none;
    color: #0073aa;
}

.scm-guide-toc a:hover {
    text-decoration: underline;
}

/* Accordion Sections */
.scm-guide-section {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
}

.scm-guide-section-toggle {
    margin: 0;
    padding: 14px 20px;
    font-size: 1.05em;
    cursor: pointer;
    background: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    user-select: none;
}

.scm-guide-section-toggle:hover {
    background: #f0f0f0;
}

.scm-guide-toggle-icon {
    font-size: 1.2em;
    font-weight: 700;
    color: #888;
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 12px;
}

.scm-guide-section.open .scm-guide-toggle-icon {
    transform: rotate(45deg);
}

.scm-guide-section-content {
    display: none;
    padding: 16px 20px 20px;
    border-top: 1px solid #e0e0e0;
}

.scm-guide-section.open .scm-guide-section-content {
    display: block;
}

.scm-guide-section-content h4 {
    font-size: 1em;
    margin: 18px 0 8px;
    color: #1d2327;
}

.scm-guide-section-content ul,
.scm-guide-section-content ol {
    padding-left: 20px;
    margin: 8px 0;
}

.scm-guide-section-content li {
    padding: 3px 0;
}

.scm-guide-section-content dl {
    margin: 10px 0;
}

.scm-guide-section-content dt {
    margin-top: 10px;
}

.scm-guide-section-content dd {
    margin-left: 20px;
    color: #555;
}

/* Tip boxes */
.scm-guide-tip {
    background: #e8f4fd;
    border-left: 4px solid #0073aa;
    padding: 10px 14px;
    margin: 12px 0;
    border-radius: 0 4px 4px 0;
    font-size: 0.93em;
}

/* Pages table */
.scm-guide-pages-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.93em;
}

.scm-guide-pages-table th,
.scm-guide-pages-table td {
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    text-align: left;
}

.scm-guide-pages-table th {
    background: #f5f5f5;
    font-weight: 600;
}

.scm-guide-pages-table tr:nth-child(even) td {
    background: #fafafa;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .scm-guide-toc ol {
        columns: 1;
    }
    .scm-guide-section-toggle {
        padding: 12px 14px;
        font-size: 1em;
    }
    .scm-guide-section-content {
        padding: 12px 14px 16px;
    }
    .scm-guide-pages-table {
        font-size: 0.85em;
    }
    .scm-guide-pages-table th,
    .scm-guide-pages-table td {
        padding: 6px 8px;
    }
}

/* ============================================================
   Featured Images Section (Community Settings)
   ============================================================ */

.scm-featured-images-section {
    margin-top: 15px;
    grid-column: 1 / -1;
}

/* Ensure description paragraphs that are direct children of the settings form span full width */
.scm-settings-form > p.scm-description {
    grid-column: 1 / -1;
}

.scm-featured-images-upload {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.scm-featured-image-slot {
    flex: 1;
    min-width: 180px;
    max-width: 250px;
}

.scm-featured-image-slot h4 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
}

.scm-featured-image-preview {
    width: 100%;
    min-height: 120px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    overflow: hidden;
    background: #fafafa;
}

.scm-featured-image-preview img {
    max-width: 100%;
    max-height: 200px;
    display: block;
}

.scm-featured-image-preview .scm-no-image {
    color: #999;
    font-size: 13px;
}

.scm-featured-image-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.scm-featured-image-controls .scm-file-input {
    width: 100%;
    margin-bottom: 4px;
}

.scm-featured-upload-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: scm-spin 0.6s linear infinite;
}

.scm-featured-upload-spinner[style*="display: inline"],
.scm-featured-upload-spinner.active {
    display: inline-block !important;
}

/* Assignment Matrix Table */
.scm-featured-matrix-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.scm-featured-matrix-table th,
.scm-featured-matrix-table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: center;
    font-size: 13px;
}

.scm-featured-matrix-table th:first-child,
.scm-featured-matrix-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.scm-featured-matrix-table thead th {
    background: #f7f7f7;
    font-weight: 600;
}

.scm-featured-matrix-table tbody tr:hover {
    background: #f9f9f9;
}

.scm-matrix-image-col.scm-matrix-disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Header columns in assignment matrix */
.scm-matrix-header-col.scm-matrix-disabled {
    opacity: 0.3;
    pointer-events: none;
}

.scm-matrix-header-none-col {
    border-left: 2px solid #bbb;
}

/* Group header rows in assignment matrix */
.scm-matrix-group-header td {
    background: #f0f0f0;
    font-weight: 600;
}
.scm-matrix-group-label {
    text-align: left !important;
    font-weight: 700;
    font-size: 13px;
}
.scm-group-all-btn {
    cursor: pointer;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    background: #f0f0f0;
    border: 1px solid #bbb;
    border-radius: 3px;
    color: #444;
    line-height: 1.4;
    white-space: nowrap;
}
.scm-group-all-btn:hover {
    background: #e0e0e0;
    border-color: #999;
}
.scm-group-all-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Page Width column in assignment matrix */
.scm-matrix-width-col {
    border-left: 2px solid #bbb;
}
.scm-page-width-input {
    width: 52px;
    padding: 4px 6px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-align: center;
}
.scm-page-width-input::placeholder {
    color: #999;
    font-style: italic;
}

/* Field icons in community settings form labels */
.scm-field-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 2px;
}

/* Header editing UI */
.scm-headers-section {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.scm-header-slot {
    flex: 1;
    min-width: 220px;
    max-width: 340px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    background: #fafafa;
}

.scm-header-slot h5 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
}

.scm-header-fields .scm-form-row {
    margin-bottom: 10px;
}

.scm-header-fields .scm-form-row label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 3px;
    color: #444;
}

.scm-header-fields .scm-input,
.scm-header-fields .scm-select {
    width: 100%;
}

.scm-color-default-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
    font-size: 12px;
    color: #666;
}

.scm-color-default-toggle input[type="checkbox"] {
    margin: 0;
}

.scm-header-fields .scm-conditional-color {
    width: 60px;
    height: 30px;
    padding: 1px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

.scm-header-container-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scm-header-container-row input[type="color"] {
    width: 40px;
    height: 30px;
    padding: 1px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
}

.scm-header-container-row input[type="range"] {
    flex: 1;
    min-width: 60px;
    cursor: pointer;
}

.scm-header-opacity-value {
    font-size: 11px;
    color: #888;
    min-width: 32px;
    text-align: right;
    flex-shrink: 0;
}

.scm-header-weight-size-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.scm-header-weight-size-row select {
    flex: 1;
}

.scm-header-weight-size-row input[type="number"] {
    width: 65px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    text-align: center;
}

.scm-header-weight-size-row .scm-size-unit {
    font-size: 11px;
    color: #888;
}

.scm-header-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.scm-header-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
}

.scm-header-options label input[type="checkbox"] {
    margin: 0;
}

.scm-header-options label input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.scm-header-options label input[type="checkbox"]:disabled + span,
.scm-header-options label:has(input:disabled) {
    opacity: 0.4;
    cursor: not-allowed;
}

.scm-header-save-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

/* Frontend: Featured image hero on community pages */
.scm-featured-hero {
    position: relative;
    text-align: center;
    line-height: 0;
}

.scm-featured-hero img {
    width: 100%;
    display: block;
}

/* Frontend: Header overlay on featured image */
.scm-header-overlay {
    line-height: 1.3;
}

/* Frontend: Standalone header block (no image) */
.scm-header-standalone {
    line-height: 1.3;
}

/* Frontend: Header content layout */
.scm-header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.scm-header-justify-left {
    justify-content: flex-start;
}

.scm-header-justify-center {
    justify-content: center;
}

.scm-header-justify-right {
    justify-content: flex-end;
}

/* Logo inside header — explicit height set inline to match text block */
.scm-header-logo-link {
    flex-shrink: 0;
    line-height: 0;
}
.scm-header-logo {
    object-fit: contain;
    flex-shrink: 0;
}

/* Header text block (heading + sub-line) */
.scm-header-text-block {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.3;
}

/* Main heading text */
.scm-header-title {
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Sub-line with location + member count — right-aligned to heading edge */
.scm-header-sub {
    align-self: flex-end;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px 6px;
    line-height: 1.3;
    margin-top: 4px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.scm-header-location,
.scm-header-members {
    display: inline-flex;
    align-items: center;
}

.scm-header-location svg,
.scm-header-members svg {
    flex-shrink: 0;
}

/* Separator between location and members — use a pseudo-element approach
   so it disappears naturally when the sub-line wraps */
.scm-header-separator {
    display: none;
}

/* Show a middot separator via CSS only when location and members are on the same line */
.scm-header-location::after {
    content: "\00b7";
    margin-left: 6px;
    opacity: 0.7;
}

.scm-featured-assign-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.scm-action-description {
    margin-top: 2px;
    font-size: 12px;
    color: #666;
    max-width: 400px;
    width: 100%;
}

.scm-section-actions {
    margin-top: 16px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    grid-column: 1 / -1;
}

.scm-section-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: scm-spin 0.6s linear infinite;
}

.scm-section-message {
    font-size: 13px;
    width: 100%;
}

.scm-featured-assign-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: scm-spin 0.6s linear infinite;
}

.scm-featured-assign-message {
    font-size: 13px;
    font-weight: 500;
}

/* Responsive: stack upload slots on mobile */
@media (max-width: 600px) {
    .scm-featured-images-upload {
        flex-direction: column;
    }
    .scm-featured-image-slot {
        max-width: 100%;
    }
    .scm-featured-matrix-table {
        font-size: 12px;
    }
    .scm-featured-matrix-table th,
    .scm-featured-matrix-table td {
        padding: 6px 4px;
    }
    .scm-headers-section {
        flex-direction: column;
    }
    .scm-header-slot {
        max-width: none;
    }
}

/* Responsive: header text on narrow screens — only scale down title */
@media (max-width: 380px) {
    .scm-header-title {
        font-size: 70% !important;
    }
    .scm-header-overlay,
    .scm-header-standalone {
        padding: 12px 10px 16px !important;
    }
}

/* ============================================================
   Page Navigation Menu (Main / Members / Directory / Admin)
   ============================================================ */

.scm-page-nav {
    text-align: right;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.scm-page-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 4px 0;
}

.scm-page-nav li {
    margin: 0;
    padding: 0;
    line-height: 1.8;
    white-space: nowrap;
}

.scm-page-nav li:not(:last-child)::after {
    content: "|";
    padding: 0 10px;
    color: #ccc;
    vertical-align: middle;
}

.scm-page-nav a {
    text-decoration: none !important;
    font-size: 14px;
    color: var(--scm-menu-text-color, var(--scm-primary-color, #0073aa));
    font-weight: 500;
}

.scm-page-nav a:hover {
    text-decoration: none;
    color: var(--scm-menu-hover-text-color, var(--scm-secondary-color, #005a87));
}

/* Nav justification classes */
.scm-page-nav.scm-nav-justify-left { text-align: left; }
.scm-page-nav.scm-nav-justify-left ul { justify-content: flex-start; }
.scm-page-nav.scm-nav-justify-center { text-align: center; }
.scm-page-nav.scm-nav-justify-center ul { justify-content: center; }
.scm-page-nav.scm-nav-justify-right { text-align: right; }
.scm-page-nav.scm-nav-justify-right ul { justify-content: flex-end; }

/* Mobile menu toggle button — hidden on desktop */
.scm-nav-toggle {
    display: none;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--scm-menu-hover-text-color, var(--scm-menu-text-color, inherit));
    background-color: var(--scm-menu-hover-bg, rgba(0, 0, 0, 0.08));
    min-height: 36px;
    line-height: 1.4;
}

.scm-nav-toggle svg {
    vertical-align: middle;
    margin-right: 6px;
    flex-shrink: 0;
}

@media screen and (max-width: 600px) {
    .scm-nav-toggle {
        display: inline-flex !important;
        align-items: center;
    }
    .scm-page-nav {
        text-align: center;
        padding: 8px 12px !important;
    }
    .scm-page-nav ul {
        display: none !important;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding-top: 6px;
    }
    .scm-page-nav ul.scm-nav-open {
        display: flex !important;
    }
    .scm-page-nav li {
        line-height: 2.2;
        white-space: normal;
        width: 100%;
    }
    .scm-page-nav li:not(:last-child)::after {
        display: none;
    }
    .scm-page-nav li:not(:last-child) {
        border-bottom: 1px solid rgba(128, 128, 128, 0.2);
    }
    .scm-page-nav a {
        display: block;
        padding: 4px 0 !important;
        text-align: left !important;
    }
}

/* =========================================================================
   Page Layout Section (Admin Settings)
   ========================================================================= */

.scm-page-layout-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    grid-column: 1 / -1;
}

.scm-page-layout-block {
    margin: 0;
}

.scm-page-layout-block h4 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
}

.scm-layout-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.scm-layout-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 1px solid #eee;
    gap: 12px;
}

.scm-layout-item:last-child {
    border-bottom: none;
}

.scm-layout-list .scm-layout-item:first-child {
    border-radius: 6px 6px 0 0;
}

.scm-layout-list .scm-layout-item:last-child {
    border-radius: 0 0 6px 6px;
}

.scm-layout-label {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
}

.scm-layout-arrows {
    display: flex;
    gap: 4px;
}

.scm-layout-arrows button {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    padding: 2px 8px;
    font-size: 11px;
    line-height: 1;
}

.scm-layout-arrows button:hover:not(:disabled) {
    background: #e0e0e0;
}

.scm-layout-arrows button:disabled {
    opacity: 0.3;
    cursor: default;
}

.scm-layout-menu-justify {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.scm-layout-menu-justify label {
    font-weight: 400;
    color: #666;
}

.scm-layout-menu-justify select {
    font-size: 13px;
    padding: 2px 6px;
}

.scm-layout-item-locked {
    background: #f5f5f5;
    opacity: 0.7;
    cursor: default;
}

.scm-layout-item-locked .scm-layout-label {
    color: #999;
}

.scm-layout-item-locked .scm-layout-arrows {
    display: none;
}

.scm-layout-inherited-badge {
    font-size: 11px;
    background: #e0e0e0;
    color: #666;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.scm-layout-item-greyed {
    background: #fafafa;
    opacity: 0.5;
    cursor: not-allowed;
}

.scm-layout-item-greyed .scm-layout-arrows button {
    pointer-events: none;
    opacity: 0.3;
}

.scm-layout-greyed-hint {
    font-size: 14px;
    color: #999;
    cursor: help;
    position: relative;
}

.scm-layout-greyed-hint[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    white-space: normal;
    width: max-content;
    max-width: 280px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.scm-layout-greyed-hint[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1001;
    pointer-events: none;
}

.scm-layout-item-hidden {
    opacity: 0.5;
}

.scm-layout-item-hidden .scm-layout-label {
    text-decoration: line-through;
}

.scm-layout-hide-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    margin-left: auto;
}

.scm-layout-hide-toggle input[type="checkbox"] {
    margin: 0;
}

.scm-page-layout-default {
    margin-bottom: 12px;
}

.scm-page-layout-page {
    margin-bottom: 8px;
}

.scm-layout-page-link {
    font-size: 14px;
    text-decoration: none;
    margin-left: 6px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.scm-layout-page-link:hover {
    opacity: 1;
}

.scm-layout-actions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    align-items: center;
    gap: 10px;
    grid-column: 1 / -1;
    width: 100%;
}

/* =========================================================================
   Event Page Layout Settings
   ========================================================================= */

.scm-event-styles-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    grid-column: 1 / -1;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    max-width: 500px;
}

.scm-event-page-layout-block {
    max-width: 340px;
}

.scm-event-styles-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
}

.scm-event-styles-toggle input[type="checkbox"] {
    margin: 0;
}

.scm-event-styles-toggle .scm-layout-hint {
    font-size: 12px;
    color: #888;
    font-style: italic;
    margin-left: 4px;
}

.scm-event-page-layout-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.scm-event-page-layout-section h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
}

.scm-event-page-layout-section p {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 13px;
}

.scm-event-page-layout-list {
    list-style: none;
    margin: 0 0 12px 0;
    padding: 0;
}

.scm-event-page-layout-list .scm-layout-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.scm-event-page-layout-list .scm-layout-item-disabled {
    background: #fafafa;
    opacity: 0.55;
}

.scm-event-page-layout-list .scm-layout-item-disabled .scm-layout-label {
    text-decoration: line-through;
    color: #999;
}

.scm-event-page-layout-list .scm-layout-item-locked {
    background: #f5f5f5;
    opacity: 0.7;
    cursor: default;
}

.scm-event-page-layout-list .scm-layout-item-locked .scm-layout-arrows {
    visibility: hidden;
}

.scm-layout-toggle {
    margin: 0;
    cursor: pointer;
}

.scm-layout-hint {
    font-size: 11px;
    color: #999;
    margin-left: auto;
    font-style: italic;
}

/* Event Page Banner (injected into TEC single event pages) */
.scm-event-page-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 16px 0;
}

.scm-event-page-banner .scm-event-host-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scm-event-page-banner .scm-event-host-logo {
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
}

.scm-event-page-banner .scm-event-host-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.scm-event-page-banner .scm-event-hosted-by {
    opacity: 0.7;
}

.scm-event-page-banner .scm-event-host-name {
    font-weight: 600;
}

.scm-event-page-banner .scm-event-btn-styled {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.scm-event-page-banner .scm-event-btn-going {
    opacity: 0.85;
}

@media (max-width: 600px) {
    .scm-event-page-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================================================================
   Frontend Full Log Styles (Management Team)
   ========================================================================= */

.scm-frontend-log-full {
    margin: 20px 0;
}

/* Filter bar */
.scm-frontend-log-full .scm-log-filters {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.scm-frontend-log-full .scm-log-filters form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.scm-frontend-log-full .scm-log-filters select,
.scm-frontend-log-full .scm-log-filters input[type="date"] {
    height: 36px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
    background: #fff;
}

.scm-frontend-log-full .scm-log-filters label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9em;
    margin: 0;
}

.scm-filter-btn {
    padding: 6px 16px;
    background: var(--scm-primary-color, #0073aa);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.scm-filter-btn:hover {
    background: var(--scm-secondary-color, #005a87);
}

/* Section headings */
.scm-frontend-log-full h3 {
    margin: 25px 0 10px;
    font-size: 1.1em;
    font-weight: 600;
}

/* Pending table */
.scm-log-table-wrap {
    overflow-x: auto;
    margin-bottom: 20px;
}

.scm-log-table-frontend {
    width: 100%;
    border-collapse: collapse;
}

.scm-log-table-frontend th,
.scm-log-table-frontend td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9em;
    vertical-align: middle;
}

.scm-log-table-frontend thead th {
    background: #f5f5f5;
    font-weight: 600;
    white-space: nowrap;
}

.scm-log-table-frontend tbody tr:hover {
    background: #f9f9f9;
}

.scm-log-table-frontend a {
    color: var(--scm-primary-color, #0073aa);
    text-decoration: none;
}

.scm-log-table-frontend a:hover {
    text-decoration: underline;
}

/* Action badges */
.scm-action-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 500;
    white-space: nowrap;
}

.scm-action-approved,
.scm-action-published {
    background: #d4edda;
    color: #155724;
}

.scm-action-rejected,
.scm-action-removed {
    background: #f8d7da;
    color: #721c24;
}

.scm-action-cancelled,
.scm-action-recalled {
    background: #fff3cd;
    color: #856404;
}

/* Verify button */
.scm-frontend-verify-log {
    padding: 4px 12px;
    background: var(--scm-primary-color, #0073aa);
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85em;
    white-space: nowrap;
}

.scm-frontend-verify-log:hover {
    background: var(--scm-secondary-color, #005a87);
}

.scm-frontend-verify-log:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Verified log timeline */
.scm-frontend-log-full .scm-verified-log {
    margin-bottom: 20px;
}

.scm-frontend-log-full .scm-verified-log .scm-log-entry {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9em;
    line-height: 1.6;
}

.scm-frontend-log-full .scm-verified-log .scm-log-date {
    color: #666;
    margin-right: 8px;
}

.scm-frontend-log-full .scm-verified-log .scm-log-text {
    margin-right: 8px;
}

.scm-frontend-log-full .scm-verified-log .scm-action-badge {
    margin-right: 6px;
    vertical-align: middle;
}

.scm-frontend-log-full .scm-crm-link,
.scm-frontend-log-full .scm-page-link {
    color: var(--scm-primary-color, #0073aa);
    text-decoration: none;
    font-size: 0.85em;
    margin-left: 6px;
}

.scm-frontend-log-full .scm-crm-link:hover,
.scm-frontend-log-full .scm-page-link:hover {
    text-decoration: underline;
}

.scm-frontend-log-full .scm-verification-info {
    display: block;
    color: #28a745;
    font-size: 0.8em;
    font-style: italic;
    margin-top: 2px;
}

/* Community name in cross-community log view */
.scm-frontend-log-full .scm-log-community {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 500;
    margin-right: 6px;
}

/* Superseded entries */
.scm-frontend-log-full .scm-log-superseded {
    opacity: 0.55;
}

.scm-frontend-log-full .scm-superseded-info {
    display: block;
    color: #999;
    font-size: 0.8em;
    font-style: italic;
    margin-top: 2px;
}

/* Pagination */
.scm-log-pagination {
    margin-top: 20px;
    text-align: center;
}

.scm-log-pagination .page-numbers {
    display: inline-block;
    padding: 4px 10px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    color: var(--scm-primary-color, #0073aa);
    font-size: 0.9em;
}

.scm-log-pagination .page-numbers.current {
    background: var(--scm-primary-color, #0073aa);
    color: #fff;
    border-color: var(--scm-primary-color, #0073aa);
}

.scm-log-pagination .page-numbers:hover:not(.current) {
    background: #f5f5f5;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .scm-frontend-log-full .scm-log-filters form {
        flex-direction: column;
        align-items: stretch;
    }

    .scm-frontend-log-full .scm-log-filters select,
    .scm-frontend-log-full .scm-log-filters input[type="date"] {
        width: 100%;
    }

    .scm-filter-btn {
        width: 100%;
    }
}
