/* Premium WordPress Dashboard - Apple-Inspired Design */
/* Complete redesign with modern aesthetics and sophisticated color palette */

/* Design System Variables - Apple-Inspired Premium Palette */
:root {
  /* Core Colors - Sophisticated Neutrals */
  --cuf-background: #ffffff;
  --cuf-foreground: #1f2937;
  --cuf-card: #fbfcfd;
  --cuf-card-foreground: #334155;
  --cuf-primary: #1f2937;
  --cuf-primary-foreground: #ffffff;
  --cuf-secondary: #923435;
  --cuf-secondary-foreground: #ffffff;
  --cuf-muted: #f8fafc;
  --cuf-muted-foreground: #64748b;
  --cuf-accent: #923435;
  --cuf-accent-foreground: #ffffff;
  --cuf-destructive: #ef4444;
  --cuf-destructive-foreground: #ffffff;
  --cuf-success: #10b981;
  --cuf-success-foreground: #ffffff;
  --cuf-warning: #f59e0b;
  --cuf-warning-foreground: #ffffff;

  /* Borders & Surfaces */
  --cuf-border: #f1f5f9;
  --cuf-border-subtle: #f8fafc;
  --cuf-input: #f8fafc;
  --cuf-ring: rgba(139, 92, 246, 0.2);

  /* Shadows - Apple-style layered depth */
  --cuf-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --cuf-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --cuf-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --cuf-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --cuf-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.02);

  /* Spacing & Layout */
  --cuf-radius-sm: 0.375rem;
  --cuf-radius: 0.5rem;
  --cuf-radius-md: 0.75rem;
  --cuf-radius-lg: 1.25rem;
  --cuf-radius-xl: 1.75rem;

  /* Typography */
  --cuf-font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Import Premium Typography */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap");

/* Global Reset & Base Styles */
* {
  box-sizing: border-box;
}

/* Dashboard Container - Full Width Premium Layout */
.cuf-ambassador-dashboard {
  font-family: var(--cuf-font-sans);
  color: var(--cuf-foreground);
  background: var(--cuf-background);
  min-height: 100vh;
  padding: 10px;
  margin: 0;
  width: 100% !important;
  max-width: none !important;
}
.cuf-ambassador-reward {
    background: #f0fff4;
    border-left: 4px solid #38a169;
    padding: 1em;
    margin-bottom: 1.5em;
    font-size: 1.05em;
    line-height: 1.5;
}

/* Promo banner */
.cuf-promo-banner{
  display:flex; gap:1.25rem; align-items:stretch; margin:1.25rem 0 2rem;
  padding:1.25rem 1.25rem; border:1px solid #e8e8e8; border-radius:12px;
  background: linear-gradient(180deg,#fff, #fafafa);
}
.cuf-promo-left{flex:1; min-width:0}
.cuf-promo-right{
  display:flex; flex-direction:column; justify-content:center; align-items:center;
  min-width:190px; border-left:1px dashed #ddd; padding-left:1.25rem; text-align:center;
}
.cuf-promo-kicker{font-size:.8rem; font-weight:600; color:#5b6a7a; text-transform:uppercase; letter-spacing:.04em}
.cuf-promo-title{margin:.35rem 0 .5rem; font-size:1.6rem}
.cuf-promo-title span{color:#0a7a3d}
.cuf-promo-text{margin:0 0 .75rem; color:#333}
.cuf-promo-points{margin:0; padding-left:1.1rem; color:#222}
.cuf-promo-points li{margin:.25rem 0}
.cuf-promo-stat{
  width:120px; height:120px; border-radius:9999px; border:6px solid #0a7a3d1a;
  display:flex; align-items:center; justify-content:center; margin-bottom:.75rem;
  background:#fff;
}
.cuf-promo-stat-num{font-size:2rem; font-weight:800; line-height:1}
.cuf-promo-stat-label{font-size:.8rem; color:#5b6a7a}
.cuf-promo-deadline{font-size:.9rem; color:#333}

@media (max-width: 820px){
  .cuf-promo-banner{flex-direction:column}
  .cuf-promo-right{border-left:none; padding-left:0}
}

/* (Removed cardified table on mobile to avoid duplication; see drop-in block at end) */

/* How it works */
.cuf-howitworks{margin:2rem 0}
.cuf-howitworks h4{margin:0 0 .75rem}
.cuf-steps{margin:.5rem 0 1.25rem; padding-left:1.25rem}
.cuf-steps li{margin:.35rem 0}
.cuf-tracking-grid{
  display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:.75rem; margin:1rem 0 0;
}
.cuf-tracking-card{
  border:1px solid #eee; border-radius:10px; padding:1rem; background:#fff;
}
.cuf-tracking-card h5{margin:0 0 .35rem}
.cuf-howitworks-footer{color:#444; margin-top:.75rem}

/* Minor onboarding tidy */
.cuf-onboarding-promo h2{margin:.35rem 0 .4rem}
.cuf-onboarding-promo h4{margin:1rem 0 .35rem}
/* Full width containers */
.cuf-dashboard-container {
  width: 100%;
  margin: 0;
  padding: 2rem 1.5rem;
  box-sizing: border-box;
}

/* Header Section - Apple-style Clean Header */
.cuf-dashboard-header {
  margin-bottom: 3rem;
}

.cuf-header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  background: var(--cuf-card);
  padding: 2.5rem 3rem;
  border-radius: var(--cuf-radius-xl);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(241, 245, 249, 0.6);
  width: 100%;
  box-sizing: border-box;
}

.cuf-header-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(146, 52, 53, 0.02);
  pointer-events: none;
}

.cuf-header-text h2 {
  margin: 0 0 0.75rem 0;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  color: var(--cuf-foreground);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.cuf-header-subtitle {
  color: var(--cuf-muted-foreground);
  margin: 0;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.5;
}

.cuf-header-actions {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

/* Stats Grid - Premium Card Design */
.cuf-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
  width: 100%;
}

.cuf-stat-card {
  background: var(--cuf-card);
  border-radius: var(--cuf-radius-xl);
  padding: 2rem;
  box-shadow: var(--cuf-shadow);
  border: 1px solid rgba(241, 245, 249, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cuf-stat-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--cuf-shadow-lg);
  border-color: rgba(139, 92, 246, 0.2);
}

.cuf-stat-card-content {
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.cuf-stat-card-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--cuf-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.cuf-stat-icon-members {
  background: var(--cuf-secondary);
  color: var(--cuf-secondary-foreground);
}
.cuf-stat-icon-topics {
  background: var(--cuf-accent);
  color: var(--cuf-accent-foreground);
}
.cuf-stat-icon-replies {
  background: var(--cuf-muted);
  color: var(--cuf-foreground);
}
.cuf-stat-icon-activity {
  background: var(--cuf-primary);
  color: var(--cuf-primary-foreground);
}

.cuf-stat-card-icon svg {
  width: 32px;
  height: 32px;
  z-index: 1;
}

.cuf-stat-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cuf-stat-value {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  color: var(--cuf-foreground);
  line-height: 1;
  letter-spacing: -0.025em;
}

.cuf-stat-label {
  color: var(--cuf-muted-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* (Removed duplicate full width dashboard grid; see drop-in block at end) */
/* Card Components - Apple-style Clean Cards */
.cuf-card {
  background: var(--cuf-card);
  border-radius: var(--cuf-radius-xl);
  box-shadow: var(--cuf-shadow);
  border: 1px solid rgba(241, 245, 249, 0.3);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  box-sizing: border-box;
}

.cuf-card:hover {
  box-shadow: var(--cuf-shadow-md);
  transform: translateY(-2px);
}

.cuf-card-header {
  background: var(--cuf-card);
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(248, 250, 252, 0.6);
}

.cuf-card-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.cuf-card-header h4 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--cuf-foreground);
  letter-spacing: -0.025em;
}

.cuf-card-content {
  padding: 1.5rem;
}
@media (min-width: 768px) {
  .cuf-card-content {
    padding: 2rem;
  }
}
/* Buttons - Premium Apple-style Buttons */
.cuf-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--cuf-radius);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--cuf-font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.cuf-button-primary {
  background: var(--cuf-secondary);
  color: var(--cuf-secondary-foreground);
  box-shadow: var(--cuf-shadow);
}

.cuf-button-primary:hover {
  background: #DD6A6C;
  transform: translateY(-1px);
  box-shadow: var(--cuf-shadow-md);
}

.cuf-button-secondary {
  background: var(--cuf-card);
  color: var(--cuf-foreground);
  border: 1px solid var(--cuf-border);
}

.cuf-button-secondary:hover {
  background: var(--cuf-muted);
  border-color: var(--cuf-secondary);
  transform: translateY(-1px);
}

.cuf-button-danger {
  background: var(--cuf-destructive);
  color: var(--cuf-destructive-foreground);
}

.cuf-button-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.cuf-button-ghost {
  background: transparent;
  color: var(--cuf-muted-foreground);
}

.cuf-button-ghost:hover {
  background: var(--cuf-muted);
  color: var(--cuf-foreground);
}

.cuf-button-small {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

/* Form Controls - Clean Apple-style Inputs */
.cuf-member-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.cuf-member-controls .cuf-search-box {
  flex: 1;
  min-width: 100%;
  max-width: 100%; /* Remove max-width restriction for full width */
}

.cuf-search-box {
  position: relative;
  flex: 1;
  min-width: 300px;
}

.cuf-search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--cuf-border);
  border-radius: var(--cuf-radius);
  background: var(--cuf-input);
  color: var(--cuf-foreground);
  font-size: 0.875rem;
  font-family: var(--cuf-font-sans);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box; /* Prevent width overflow */
}

.cuf-search-input:focus {
  outline: none;
  border-color: var(--cuf-secondary);
  box-shadow: 0 0 0 3px var(--cuf-ring);
  background: var(--cuf-background);
}

.cuf-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cuf-muted-foreground);
  pointer-events: none;
}

.cuf-select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--cuf-border);
  border-radius: var(--cuf-radius);
  background: var(--cuf-input);
  color: var(--cuf-foreground);
  font-size: 0.875rem;
  font-family: var(--cuf-font-sans);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cuf-select:focus {
  outline: none;
  border-color: var(--cuf-secondary);
  box-shadow: 0 0 0 3px var(--cuf-ring);
}

/* (Removed duplicate table styles; see drop-in block at end) */

/* Ensure full member names are visible under the Member column */
.cuf-member-table td:nth-of-type(2) { max-width: none; }
.cuf-member-table td:nth-of-type(2) .cuf-member-name {
  white-space: normal;     /* allow wrapping */
  overflow: visible;       /* show full content */
  text-overflow: unset;    /* remove ellipsis */
  max-width: none;         /* remove width cap */
}

.cuf-member-row:hover {
  background: rgba(248, 250, 252, 0.6);
}

.cuf-member-row:last-child td {
  border-bottom: none;
}

/* Member Info Styling */
.cuf-member-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cuf-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--cuf-radius);
  border: 2px solid var(--cuf-border);
}

.cuf-member-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0; /* Allow flex item to shrink */
}

.cuf-member-name {
  font-weight: 500;
  color: var(--cuf-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px; /* Prevent name overflow */
}

.cuf-member-email {
  font-size: 0.8125rem;
  color: var(--cuf-muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px; /* Prevent email overflow */
}

/* Role Badges */
.cuf-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--cuf-radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cuf-role-admin {
  background: var(--cuf-destructive);
  color: var(--cuf-destructive-foreground);
}

.cuf-role-ambassador {
  background: var(--cuf-secondary);
  color: var(--cuf-secondary-foreground);
}

.cuf-role-member {
  background: var(--cuf-muted);
  color: var(--cuf-muted-foreground);
}

/* Checkbox Styling - Enhanced for better visibility and functionality */
.cuf-checkbox-column {
  width: 3rem;
  text-align: center;
  vertical-align: middle;
  position: relative;
  padding: 0 !important;
}

.cuf-checkbox-column:empty::before {
  content: "";
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  visibility: hidden;
}

.cuf-member-table th.cuf-checkbox-column {
  text-align: center;
  padding: 1rem 0.5rem;
}

.cuf-checkbox-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  padding: 0.25rem;
  border-radius: var(--cuf-radius-sm);
  transition: background-color 0.2s ease;
  width: 100%;
  height: 100%;
}

.cuf-checkbox-label:hover {
  background-color: rgba(139, 92, 246, 0.05);
}

.cuf-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--cuf-border);
  border-radius: 0.375rem;
  background: var(--cuf-background);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
  flex-shrink: 0;
  margin: 0;
  display: inline-block;
  opacity: 1 !important;
  visibility: visible !important;
}

.cuf-checkbox:checked {
  background: var(--cuf-secondary);
  border-color: var(--cuf-secondary);
  box-shadow: 0 0 0 1px var(--cuf-secondary);
}

.cuf-checkbox:checked::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 5px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.cuf-checkbox:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.cuf-checkbox:hover {
  border-color: var(--cuf-secondary);
}

/* Quick Actions Sidebar */
.cuf-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cuf-quick-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--cuf-background);
  border: 1px solid var(--cuf-border);
  border-radius: var(--cuf-radius);
  color: var(--cuf-foreground);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.cuf-quick-action:hover {
  background: var(--cuf-muted);
  border-color: var(--cuf-secondary);
  transform: translateX(4px);
}

/* Activity Feed */
.cuf-activity-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cuf-activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--cuf-background);
  border: 1px solid var(--cuf-border-subtle);
  border-radius: var(--cuf-radius);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cuf-activity-item:hover {
  background: var(--cuf-muted);
  border-color: var(--cuf-border);
}

.cuf-activity-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--cuf-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cuf-activity-topic {
  background: var(--cuf-secondary);
  color: var(--cuf-secondary-foreground);
}

.cuf-activity-reply {
  background: var(--cuf-success);
  color: var(--cuf-success-foreground);
}

.cuf-activity-content {
  flex: 1;
  min-width: 0;
}

.cuf-activity-title {
  display: block;
  font-weight: 500;
  color: var(--cuf-foreground);
  text-decoration: none;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.cuf-activity-title:hover {
  color: var(--cuf-secondary);
}

.cuf-activity-meta {
  font-size: 0.75rem;
  color: var(--cuf-muted-foreground);
}

/* Bulk Actions Bar */
.cuf-bulk-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--cuf-secondary);
  color: var(--cuf-secondary-foreground);
  border-radius: var(--cuf-radius);
  margin-top: 1rem;
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cuf-bulk-info {
  font-weight: 500;
}

.cuf-bulk-buttons {
  display: flex;
  gap: 0.75rem;
}

/* Notice Messages */
.cuf-notice {
  padding: 1rem 1.5rem;
  border-radius: var(--cuf-radius);
  margin-bottom: 1.5rem;
  border-left: 4px solid;
}

.cuf-notice-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--cuf-success);
  color: var(--cuf-success);
}

.cuf-notice-error {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--cuf-destructive);
  color: var(--cuf-destructive);
}

/* Pending Application Notice */
.cuf-pending-notice {
    background: var(--cuf-secondary);
    border: none;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(146, 52, 53, 0.3);
    overflow: hidden;
}

.cuf-pending-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    color: white;
}

.cuf-pending-icon {
    flex-shrink: 0;
    background: rgba(233, 220, 182, 0.2);
    border-radius: 50%;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.cuf-pending-icon svg {
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.cuf-pending-text h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--cuf-secondary-foreground);
}

.cuf-pending-text p {
    font-size: 1rem;
    line-height: 1.5;
    margin: 0 0 0.75rem 0;
    color: var(--cuf-secondary-foreground);
}

.cuf-pending-details {
    opacity: 0.9;
}

.cuf-pending-details small {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--cuf-secondary-foreground);
}

@media (max-width: 768px) {
    .cuf-pending-content {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .cuf-pending-icon {
        margin-bottom: 0.5rem;
    }
    
    .cuf-pending-text h3 {
        font-size: 1.125rem;
    }
    
    .cuf-pending-text p {
        font-size: 0.875rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
  .cuf-dashboard-container {
    padding: 1rem; /* Reduce padding on mobile */
  }
  
  .cuf-dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
  }
  
  .cuf-dashboard-sidebar {
    order: -1;
    min-width: 100%; /* Full width sidebar on mobile */
  }
  
  .cuf-header-content {
    padding: 1.5rem; /* Reduce padding on mobile */
    flex-direction: column;
    align-items: stretch;
  }
  
  .cuf-member-table {
    min-width: 600px; /* Reduce min-width on mobile */
    font-size: 0.8125rem;
  }
  
  .cuf-member-table th,
  .cuf-member-table td {
    padding: 0.75rem 1rem;
  }
  
  .cuf-member-name,
  .cuf-member-email {
    max-width: 150px; /* Reduce max-width on mobile */
  }
  
  .cuf-stats-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
  }
}

  .cuf-header-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }


@media (max-width: 768px) {
  .cuf-dashboard-container {
    padding: 1rem;
  }

  .cuf-single-topic {
    padding: 1rem;
  }

  .cuf-topic-original-post {
    flex-direction: column;
    padding: 1.5rem;
    margin-bottom: 10px;
  }

  .cuf-topic-author-info {
    text-align: center;
    margin-right: 0;
    margin-bottom: 1.5rem;
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--cuf-border);
    padding-bottom: 1.5rem;
  }

  .cuf-reply-item {
    flex-direction: column;
    padding-bottom: 10px;
    margin-bottom: 10px;
  }

  .cuf-reply-author {
    text-align: center;
    margin-bottom: 1rem;
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--cuf-border);
    padding-bottom: 1rem;
  }

  .cuf-breadcrumb {
        padding: 0.875rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .cuf-breadcrumb ol {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .cuf-breadcrumb li {
        width: 100%;
    }
    
    .cuf-breadcrumb li:not(:last-child)::after {
        display: none;
    }
    
    .cuf-breadcrumb a,
    .cuf-breadcrumb [aria-current="page"] {
        display: block;
        width: 100%;
        text-align: left;
        padding: 0.5rem 0.75rem;
    }

  .cuf-stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .cuf-member-controls {
    flex-direction: column;
    gap: 1rem;
  }

  .cuf-search-box {
    min-width: auto;
  }

  .cuf-header-content {
    padding: 1.5rem 2rem;
  }

  .cuf-card-content {
    padding: 1.5rem;
  }

  .cuf-member-table {
    min-width: 500px;
  }

  .cuf-bulk-actions-bar {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 1rem;
  }

  .cuf-stats-bar {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .cuf-main-controls {
    padding: 10px;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .cuf-topic-list-header,
  .cuf-topic-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .cuf-topic-replies-col,
  .cuf-topic-activity-col {
    width: auto;
    text-align: left;
  }

  .cuf-topic-list-header .cuf-topic-replies-col,
  .cuf-topic-list-header .cuf-topic-activity-col {
    display: none;
  }

  .cuf-topic-item .cuf-topic-replies-col::before {
    content: "Replies: ";
    font-weight: 500;
  }

  .cuf-topic-item .cuf-topic-activity-col::before {
    content: "Last Activity: ";
    font-weight: 500;
  }

  .cuf-welcome-header {
    padding: 1.5rem 2rem;
  }

  .cuf-topic-original-post .entry-header,
  .cuf-topic-original-post .entry-content,
  .cuf-topic-original-post .entry-footer {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
        margin-bottom: 10px;

  }

  .cuf-modal-content {
    padding: 1.5rem;
    margin: 1rem;
  }

  .forums-list {
    grid-template-columns: 1fr;
  }

  /* Reply Form Mobile Styles */
  .cuf-reply-form-container {
    padding: 1.5rem;
    margin-top: 1.5rem;
    border-radius: 12px;
  }
  
  .cuf-reply-form-header h3 {
    font-size: 1.25rem;
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .cuf-reply-form textarea {
    min-height: 120px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
  }
  
  .cuf-submit-reply {
    width: 100%;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    min-width: auto;
  }
  
  .cuf-login-prompt,
  .cuf-permission-notice {
    padding: 1.5rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .cuf-dashboard,
  .cuf-single-topic {
    padding: 1rem;
  }

  .cuf-topic-author-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .cuf-reply-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .cuf-stat-card-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .cuf-header-actions {
    flex-direction: column;
    width: 100%;
  }

  .cuf-button {
    width: 100%;
    justify-content: center;
  }
}

/* Screen Reader Only Text */
.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Focus States for Accessibility */
.cuf-button:focus,
.cuf-quick-action:focus,
.cuf-activity-title:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--cuf-ring);
}

/* Loading States */
.cuf-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Utility Classes */
.cuf-no-data {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--cuf-muted-foreground);
  font-style: italic;
}

.cuf-protected-user {
  font-size: 0.75rem;
  color: var(--cuf-muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cuf-joined-date,
.cuf-activity-count {
  font-size: 0.8125rem;
  color: var(--cuf-muted-foreground);
}

.cuf-action-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Adding comprehensive styles for forum templates */

/* Forum Archive Page - University Forums List */
.forums-list-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem; /* add breathing room around forum index */
}

.page-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.page-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--cuf-foreground);
  margin: 0;
  letter-spacing: -0.025em;
}

.forums-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem; /* more space between forum cards */
  list-style: none;
  padding: 0;
  margin: 0;
}

.forum-item {
  background: var(--cuf-background);
  border: 1px solid var(--cuf-border);
  border-radius: var(--cuf-radius-lg);
  padding: 2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--cuf-shadow);
  position: relative;
  overflow: hidden;
}

.forum-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--cuf-secondary);
  transform: scaleX(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.forum-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--cuf-shadow-xl);
  border-color: var(--cuf-secondary);
}

.forum-item:hover::before {
  transform: scaleX(1);
}

.forum-item a {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--cuf-foreground);
  text-decoration: none;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  transition: color 0.2s ease;
}

.forum-item a:hover {
  color: var(--cuf-secondary);
}

.forum-excerpt {
  color: var(--cuf-muted-foreground);
  line-height: 1.6;
  font-size: 0.9rem;
}

/* Single Forum Page - Dashboard Style */
.cuf-dashboard,
.cuf-single-topic {
  font-family: var(--cuf-font-sans);
  color: var(--cuf-foreground);
  background: var(--cuf-background);
  min-height: 100vh;
  padding: 1.25rem 1rem;
}

.cuf-welcome-header {
  background: var(--cuf-background);
  padding: 20px;
  margin:20px;
  border-radius: var(--cuf-radius-lg);
  box-shadow: var(--cuf-shadow);
  border: 1px solid var(--cuf-border);
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.cuf-welcome-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--cuf-secondary);
}

.cuf-welcome-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--cuf-foreground);
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.025em;
}

.cuf-welcome-subtitle {
  color: var(--cuf-muted-foreground);
  font-size: 1.125rem;
  margin: 0;
  font-weight: 400;
}

/* Stats Bar */
.cuf-stats-bar {
  display: flex;
  gap: 1rem;
  background: var(--cuf-background);
  padding: 0.75rem 1rem;
  border-radius: var(--cuf-radius);
  box-shadow: var(--cuf-shadow-sm);
  border: 1px solid var(--cuf-border);
  margin-bottom: 1rem;
  justify-content: center;
}

.cuf-stat-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cuf-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--cuf-secondary);
  line-height: 1;
}

.cuf-stat-label {
  font-size: 0.875rem;
  color: var(--cuf-muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Main Controls */
.cuf-main-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem;
  
  padding: 1.25rem 1.5rem;
  background: var(--cuf-background);
  border-radius: var(--cuf-radius);
  box-shadow: var(--cuf-shadow);
  border: 1px solid var(--cuf-border);
}

.cuf-main-controls h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--cuf-foreground);
}

/* Topic List */
.forum-topics-list {
  background: var(--cuf-background);
  border-radius: var(--cuf-radius);
  border: 1px solid var(--cuf-border);
  box-shadow: var(--cuf-shadow);
  overflow: hidden;
  padding: 0.75rem; /* inner padding so content isn't flush */
}

.cuf-topic-list-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--cuf-card);
  border-bottom: 1px solid var(--cuf-border);
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--cuf-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cuf-topic-title-col {
  min-width: 0;
}

.cuf-topic-replies-col,
.cuf-topic-activity-col {
  width: 100px;
  text-align: center;
}

.cuf-topic-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--cuf-border-subtle);
  transition: all 0.2s ease;
  align-items: center;
}

.cuf-topic-item:hover {
  background: var(--cuf-muted);
}

.cuf-topic-item:last-child {
  border-bottom: none;
}

.cuf-topic-item .cuf-topic-title-col a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--cuf-foreground);
  text-decoration: none;
  line-height: 1.35;
  display: block;
  margin-bottom: 0.25rem;
}

.cuf-topic-item .cuf-topic-title-col a:hover {
  color: var(--cuf-secondary);
}

.cuf-topic-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--cuf-muted-foreground);
}

.cuf-topic-author img {
  border-radius: var(--cuf-radius-sm);
}

.cuf-topic-author-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cuf-topic-author-meta img {
  border-radius: var(--cuf-radius);
  border: 2px solid var(--cuf-border);
}

.cuf-topic-author-meta div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cuf-topic-author-meta strong {
  color: var(--cuf-foreground);
  font-weight: 600;
}

.cuf-topic-author-meta span {
  color: var(--cuf-muted-foreground);
  font-size: 0.875rem;
}

.cuf-topic-original-post {
  background: var(--cuf-background);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  border: 1px solid var(--cuf-border);
  overflow: hidden;
}

.cuf-topic-original-post .entry-header {
  padding: 2rem 2.5rem 1rem;
  border-bottom: 1px solid var(--cuf-border-subtle);
}

.cuf-topic-original-post .entry-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--cuf-foreground);
  margin: 0 0 1rem 0;
  line-height: 1.2;
}

.cuf-topic-original-post .entry-content {
  padding: 2rem 2.5rem;
  line-height: 1.7;
  color: var(--cuf-foreground);
}

.cuf-topic-original-post .entry-footer {
  padding: 1rem 2.5rem;
  border-top: 1px solid var(--cuf-border-subtle);
  background: var(--cuf-card);
}

/* Replies Container */
.cuf-replies-container {
  margin-bottom: 2rem;
  display: grid;               /* enforce consistent spacing between replies */
  grid-template-columns: 1fr;
  row-gap: 2rem;               /* increase vertical gap between reply containers */
}

.cuf-replies-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--cuf-foreground);
  margin: 0 0 1.5rem 0;
  padding: 1rem 0;
  border-bottom: 2px solid var(--cuf-border);
}

.cuf-reply-item {
  background: var(--cuf-background);
  border: 1px solid var(--cuf-border);
  border-radius: var(--cuf-radius-lg);
  margin-bottom: 2rem;
  overflow: hidden;
  transition: all 0.2s ease;
}

.cuf-reply-item:hover {
  box-shadow: var(--cuf-shadow-md);
  border-color: var(--cuf-secondary);
}

.cuf-reply-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--cuf-card);
  border-bottom: 1px solid var(--cuf-border-subtle);
}

.cuf-reply-author img {
  border-radius: var(--cuf-radius-sm);
  border: 2px solid var(--cuf-border);
}

.cuf-reply-author strong {
  color: var(--cuf-foreground);
  font-weight: 600;
}

.cuf-reply-content {
  padding: 1.5rem;
}

.cuf-reply-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: var(--cuf-muted-foreground);
}

.cuf-reply-text {
  line-height: 1.7;
  color: var(--cuf-foreground);
}

.cuf-delete-link {
  color: var(--cuf-destructive);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8125rem;
}

.cuf-delete-link:hover {
  text-decoration: underline;
}

/* Reply Trigger Area */
.cuf-reply-trigger-area {
  text-align: center;
  padding: 2rem;
  background: var(--cuf-background);
  border-radius: var(--cuf-radius-lg);
  border: 1px solid var(--cuf-border);
  box-shadow: var(--cuf-shadow);
}

.cuf-login-prompt {
  text-align: center;
  padding: 2rem;
  background: var(--cuf-card);
  border-radius: var(--cuf-radius-lg);
  border: 1px solid var(--cuf-border);
  color: var(--cuf-muted-foreground);
  font-style: italic;
}

.cuf-login-prompt a {
  color: var(--cuf-secondary);
  text-decoration: none;
  font-weight: 500;
}

.cuf-login-prompt a:hover {
  text-decoration: underline;
}

/* Enhanced Forum Topic Styling - Modern Forum Layout */
.cuf-single-topic {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.cuf-breadcrumb {
    margin-bottom: 2rem;
    background: var(--cuf-muted);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--cuf-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cuf-breadcrumb ol {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
    font-weight: 500;
}

.cuf-breadcrumb li {
    display: flex;
    align-items: center;
    position: relative;
}

.cuf-breadcrumb li:not(:last-child)::after {
    content: '-';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid var(--cuf-border);
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
    margin-left: 0.75rem;
    opacity: 0.7;
}

.cuf-breadcrumb a {
    color: var(--cuf-primary);
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.1);
    transition: all 0.2s ease;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.cuf-breadcrumb a:hover {
    color: var(--cuf-primary-foreground);
    background: var(--cuf-primary);
    border-color: var(--cuf-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.cuf-breadcrumb [aria-current="page"] {
    color: var(--cuf-muted-foreground);
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    background: var(--cuf-background);
    border-radius: 6px;
    border: 1px solid var(--cuf-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Enhanced Topic Post - Classic Forum Style */
.cuf-topic-original-post {
  background: var(--cuf-background);
  border: 1px solid var(--cuf-border);
  border-radius: var(--cuf-radius-xl);
  margin-bottom: 3rem;
  overflow: hidden;
  box-shadow: var(--cuf-shadow-lg);
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 200px;
}

.cuf-topic-author-info {
  background: var(--cuf-card);
  padding: 2rem;
  border-right: 1px solid var(--cuf-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cuf-topic-author-info .avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 1rem;
  border: 3px solid var(--cuf-secondary);
}

.cuf-author-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--cuf-foreground);
  margin-bottom: 0.5rem;
}

.cuf-author-role {
  font-size: 0.8125rem;
  color: var(--cuf-muted-foreground);
  margin-bottom: 0.75rem;
  padding: 0.3rem 0.625rem;
  background: var(--cuf-muted);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.6rem;
  line-height: 1;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal; /* allow wrap if needed */
  overflow: visible;
  text-overflow: clip;
  text-align: center;
}

.cuf-author-stats {
  font-size: 0.8125rem;
  color: var(--cuf-muted-foreground);
  margin-top: auto;
}

.cuf-topic-content-wrapper {
  padding: 0;
}

.cuf-topic-original-post .entry-header {
  padding: 2rem;
  border-bottom: 1px solid var(--cuf-border);
  background: var(--cuf-card);
}

.cuf-topic-original-post .entry-title {
  font-size: clamp(2rem, 5vw, 2.5rem);
  font-weight: 700;
  color: var(--cuf-foreground);
  margin: 0 0 1rem 0;
  line-height: 1.3;
  border-bottom: 2px solid var(--cuf-primary);
  padding-bottom: 0.75rem;
}

.cuf-topic-meta {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  font-size: 0.875rem;
  color: var(--cuf-muted-foreground);
}

.cuf-topic-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cuf-topic-original-post .entry-content {
  padding: 2rem;
  line-height: 1.8;
  color: var(--cuf-foreground);
  font-size: 1rem;
}

.cuf-topic-original-post .entry-content p {
  margin-bottom: 1rem;
}

.cuf-topic-original-post .entry-content p:last-child {
  margin-bottom: 0;
}

.cuf-topic-original-post .entry-footer {
  padding: 1rem 2rem;
  border-top: 1px solid var(--cuf-border);
  background: var(--cuf-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Enhanced Replies Section */
.cuf-replies-container {
  margin-bottom: 3rem;
}

.cuf-replies-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--cuf-card);
  border: 1px solid var(--cuf-border);
  border-radius: var(--cuf-radius-lg);
}

.cuf-replies-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cuf-foreground);
  margin: 0;
}

/* Enhanced Reply Items - Forum Post Style */
.cuf-reply-item {
  background: var(--cuf-background);
  border: 1px solid var(--cuf-border);
  border-radius: var(--cuf-radius-xl);
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: var(--cuf-shadow);
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 150px;
}

.cuf-reply-author {
  background: var(--cuf-card);
  padding: 1.5rem;
  border-right: 1px solid var(--cuf-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  overflow: hidden; /* prevent child pill overflow */
}

.cuf-reply-author .avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-bottom: 0.75rem;
  border: 2px solid var(--cuf-border);
}

.cuf-reply-author strong {
  font-weight: 600;
  color: var(--cuf-foreground);
  margin-bottom: 0.25rem;
}

.cuf-reply-content-wrapper {
  padding: 0;
}

.cuf-reply-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--cuf-border);
  background: var(--cuf-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cuf-reply-date {
  font-size: 0.875rem;
  color: var(--cuf-muted-foreground);
}

.cuf-reply-content {
  padding: 1.5rem;
  line-height: 1.8;
  color: var(--cuf-foreground);
}

.cuf-reply-text {
  line-height: 1.8;
  color: var(--cuf-foreground);
}

/* Enhanced Action Buttons */
.cuf-reply-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.cuf-reply-actions .cuf-delete-link {
  font-size: 0.8125rem;
  padding: 0.25rem 0.5rem;
  color: var(--cuf-destructive);
  text-decoration: none;
  border-radius: var(--cuf-radius-sm);
  transition: all 0.2s ease;
}

.cuf-reply-actions .cuf-delete-link:hover {
  background: var(--cuf-destructive);
  color: white;
  text-decoration: none;
}

/* Enhanced Reply Area */
.cuf-reply-area {
  background: var(--cuf-background);
  border: 1px solid var(--cuf-border);
  border-radius: var(--cuf-radius-xl);
  padding: 2rem;
  box-shadow: var(--cuf-shadow-lg);
}

.cuf-reply-trigger-area {
  text-align: center;
  padding: 2rem;
}

/* Responsive Design for Forum Layout */
@media (max-width: 768px) {
  .cuf-single-topic {
    padding: 1rem;
  }
  
  .cuf-topic-original-post,
  .cuf-reply-item {
    grid-template-columns: 1fr;
  }
  
  .cuf-topic-author-info,
  .cuf-reply-author {
    border-right: none;
    border-bottom: 1px solid var(--cuf-border);
    padding: 1.5rem;
  }
  
  .cuf-topic-original-post .entry-header,
  .cuf-topic-original-post .entry-content,
  .cuf-topic-original-post .entry-footer {
    padding: 1.5rem;
  }
  
  .cuf-replies-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .cuf-reply-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Modal Styles - Elegant Overlays */
.cuf-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cuf-modal[aria-hidden="false"] {
  display: flex;
}

.cuf-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}

.cuf-modal-content {
  background: var(--cuf-card);
  border-radius: var(--cuf-radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(241, 245, 249, 0.6);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  z-index: 1001;
  /* Add comfortable padding on desktop */
  padding: 2rem;
}

.cuf-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--cuf-muted-foreground);
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--cuf-radius);
  transition: all 0.2s ease;
}

.cuf-modal-close:hover {
  background: var(--cuf-muted);
  color: var(--cuf-foreground);
}

.cuf-modal h3 {
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--cuf-foreground);
}

/* Form Styles in Modals */
.cuf-modal form p {
  margin-bottom: 1.5rem;
}

.cuf-modal label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--cuf-foreground);
}

.cuf-modal input[type="text"],
.cuf-modal textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--cuf-border) !important;
  border-radius: var(--cuf-radius);
  background: var(--cuf-input) !important;
  color: var(--cuf-foreground);
  font-size: 0.875rem;
  font-family: var(--cuf-font-sans);
  transition: all 0.2s ease;
}

.cuf-modal input[type="text"]:focus,
.cuf-modal textarea:focus {
  outline: none;
  border-color: var(--cuf-secondary) !important;
  box-shadow: 0 0 0 3px var(--cuf-ring) !important;
  background: var(--cuf-background) !important;
}

/* Ensure modal buttons use CUF styles (override theme defaults) */
.cuf-modal .cuf-button,
.cuf-modal input[type="submit"].cuf-button {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  text-shadow: none;
  box-shadow: none;
}

.cuf-modal .cuf-button-primary,
.cuf-modal input[type="submit"].cuf-button-primary {
  background: var(--cuf-secondary);
  color: var(--cuf-secondary-foreground);
}

.cuf-modal .cuf-button-primary:hover,
.cuf-modal input[type="submit"].cuf-button-primary:hover {
  background: #DD6A6C;
}

/* WordPress Editor Styling */
.cuf-modal .wp-editor-wrap {
  border: 1px solid var(--cuf-border);
  border-radius: var(--cuf-radius);
  overflow: hidden;
}

.cuf-modal .wp-editor-container textarea {
  border: none;
  border-radius: 0;
}

/* WordPress Editor toolbar consistency inside modal */
.cuf-modal .wp-editor-tools,
.cuf-modal .mce-toolbar-grp,
.cuf-modal .quicktags-toolbar {
  background: var(--cuf-input) !important;
  border-bottom: 1px solid var(--cuf-border) !important;
  font-family: var(--cuf-font-sans);
}

.cuf-modal .mce-statusbar {
  background: var(--cuf-input) !important;
  border-top: 1px solid var(--cuf-border) !important;
}

/* End of forum template styles */

/* Reply Form */
.cuf-reply-form-container {
    background: var(--cuf-card);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--cuf-border);
    padding: 2.5rem;
    margin-top: 2.5rem;
    position: relative;
    overflow: hidden;
}

.cuf-reply-form-container::before {
    content: '-';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--cuf-secondary);
}

.cuf-reply-form-header {
    margin-bottom: 2rem;
    text-align: center;
}

.cuf-reply-form-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cuf-foreground);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cuf-reply-form {
    max-width: 100%;
}

.cuf-reply-form .cuf-form-group {
    margin-bottom: 1.5rem;
}

.cuf-reply-form textarea {
    width: 100%;
    min-height: 140px;
    padding: 1rem 1.25rem;
    border: 2px solid var(--cuf-border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    background: var(--cuf-background);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cuf-reply-form textarea:focus {
    outline: none;
    border-color: var(--cuf-secondary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15), 0 4px 12px rgba(139, 92, 246, 0.1);
    transform: translateY(-1px);
}

.cuf-reply-form textarea::placeholder {
    color: var(--cuf-muted-foreground);
    font-style: italic;
}

.cuf-form-actions {
    text-align: center;
}

.cuf-submit-reply {
    background: var(--cuf-secondary);
    color: var(--cuf-secondary-foreground);
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 200px;
    justify-content: center;
}

.cuf-submit-reply:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.cuf-submit-reply:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Form Labels and Helper Text */
.cuf-form-helper {
    font-size: 0.875rem;
    color: var(--cuf-muted-foreground);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Login Prompt Styling */
.cuf-login-prompt {
    text-align: center;
    padding: 2rem;
    background: var(--cuf-muted);
    border-radius: 12px;
    border: 1px solid var(--cuf-border);
    color: var(--cuf-foreground);
    font-weight: 500;
}

.cuf-login-prompt a {
    color: var(--cuf-secondary);
    font-weight: 600;
    text-decoration: none;
}

.cuf-login-prompt a:hover {
    text-decoration: underline;
}

/* Permission Notice */
.cuf-permission-notice {
    text-align: center;
    padding: 2rem;
    background: var(--cuf-secondary);
    border-radius: 12px;
    border: 1px solid var(--cuf-secondary);
    color: var(--cuf-secondary-foreground);
    font-weight: 500;
}

.cuf-integration-status {
    margin: 0.5rem 0;
    font-weight: 600;
}

.cuf-integration-status-ok {
    color: var(--cuf-success);
}

.cuf-integration-status-error {
    color: var(--cuf-destructive);
}
/* --- 8. Ambassador Onboarding Page --- */

.cuf-onboarding-container {
    max-width: 1100px;
    margin: 2.5rem auto;
    padding: 2.5rem;
    background: var(--cuf-background);
    border: 1px solid var(--cuf-border);
    border-radius: var(--cuf-radius-lg);
    box-shadow: var(--cuf-shadow-lg);
}

.cuf-brand-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.cuf-brand-logo {
    height: 44px;
    width: auto;
    display: block;
}

.cuf-brand-wordmark {
    font-weight: 700;
    font-size: 1.65rem;
    letter-spacing: -0.01em;
    color: var(--cuf-primary);
}

.cuf-brand-wordmark span {
    color: var(--cuf-secondary);
}

.cuf-onboarding-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 3rem;
}

.cuf-onboarding-promo {
    padding-right: 2rem;
    border-right: 1px solid var(--cuf-border);
}

.cuf-onboarding-promo h2 {
    margin: 0 0 0.75rem 0;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--cuf-foreground);
    line-height: 1.1;
}

.cuf-onboarding-promo h4 {
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.75rem;
    font-size: 1.2rem;
    color: var(--cuf-primary);
    border-bottom: 1px solid var(--cuf-border);
}

.cuf-onboarding-promo p {
    margin: 0 0 1rem;
    line-height: 1.7;
    color: var(--cuf-muted-foreground);
}

.cuf-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cuf-benefits-list li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.cuf-benefits-list li::before {
    content: '-';
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1.25rem;
    color: var(--cuf-secondary);
    line-height: 1;
}

.cuf-onboarding-form-wrap {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.cuf-form {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.cuf-form-section {
    margin: 0;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--cuf-border);
}

.cuf-form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.cuf-form-section h5 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cuf-foreground);
}

.cuf-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.cuf-form-group {
    margin: 0;
}

.cuf-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--cuf-foreground);
}

.cuf-input,
.cuf-select,
.cuf-textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--cuf-border);
    border-radius: var(--cuf-radius);
    background: var(--cuf-background);
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cuf-input:focus,
.cuf-select:focus,
.cuf-textarea:focus {
    outline: none;
    border-color: var(--cuf-secondary);
    box-shadow: 0 0 0 3px rgba(146, 52, 53, 0.15);
}

.cuf-input-disabled {
    background: var(--cuf-muted);
    color: var(--cuf-muted-foreground);
}

.cuf-input-error {
    border-color: var(--cuf-destructive) !important;
}

.cuf-textarea {
    min-height: 140px;
    resize: vertical;
}

.cuf-field-help {
    display: block;
    margin-top: 0.3rem;
    color: var(--cuf-muted-foreground);
    font-size: 0.85rem;
}

.cuf-checkbox-group {
    display: block;
}

.cuf-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.95rem;
    color: var(--cuf-foreground);
}

.cuf-checkbox input[type="checkbox"] {
    margin-top: 0.2rem;
}

.cuf-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.1rem;
    border-radius: var(--cuf-radius);
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cuf-button-primary {
    background: var(--cuf-secondary);
    color: var(--cuf-secondary-foreground);
    box-shadow: var(--cuf-shadow-md);
}

.cuf-button-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--cuf-shadow-lg);
}

.cuf-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.cuf-button-full {
    width: 100%;
}

.button-spinner {
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
}

.is-hidden {
    display: none !important;
}

.cuf-card-subtitle {
    margin-top: 0.35rem;
    color: var(--cuf-muted-foreground);
    font-size: 0.95rem;
}

.cuf-card-feedback {
    text-align: center;
}

.cuf-muted-text {
    margin-top: 0.5rem;
    color: var(--cuf-muted-foreground);
    font-size: 0.9rem;
}

.cuf-promo-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--cuf-border);
    border-radius: var(--cuf-radius-lg);
    background: var(--cuf-muted);
}

.cuf-promo-trigger__icon {
    font-size: 1.35rem;
}

.cuf-promo-trigger__text {
    flex: 1;
    font-weight: 600;
    color: var(--cuf-foreground);
}

.cuf-promo-trigger__button {
    border: none;
    border-radius: var(--cuf-radius);
    background: var(--cuf-secondary);
    color: var(--cuf-secondary-foreground);
    font-weight: 600;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
}

.cuf-promo-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(17, 24, 39, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 9999;
}

.cuf-promo-modal__backdrop {
    position: absolute;
    inset: 0;
}

.cuf-promo-modal.is-active {
    opacity: 1;
    pointer-events: auto;
}

.cuf-promo-modal__dialog {
    background: var(--cuf-background);
    border-radius: var(--cuf-radius-lg);
    border: 1px solid var(--cuf-border);
    box-shadow: var(--cuf-shadow-xl);
    max-width: 640px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.cuf-promo-modal__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    border: none;
    background: transparent;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--cuf-muted-foreground);
}

.cuf-promo-modal__content {
    padding: 2.25rem 2.5rem;
}

.cuf-promo-kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cuf-secondary);
    margin-bottom: 0.75rem;
}

.cuf-promo-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--cuf-foreground);
}

.cuf-promo-text {
    margin: 0 0 1.25rem 0;
    color: var(--cuf-muted-foreground);
    line-height: 1.7;
}

.cuf-promo-points {
    margin: 0 0 1.25rem 0;
    padding-left: 1.25rem;
    color: var(--cuf-foreground);
}

.cuf-promo-points li {
    margin-bottom: 0.65rem;
}

.cuf-promo-deadline {
    padding: 1rem;
    border: 1px dashed var(--cuf-secondary);
    border-radius: var(--cuf-radius);
    background: rgba(146, 52, 53, 0.05);
    font-size: 0.95rem;
    color: var(--cuf-foreground);
}

.cuf-how-it-works {
    border: 1px solid var(--cuf-border);
    border-radius: var(--cuf-radius-lg);
    padding: 1.75rem;
    background: var(--cuf-muted);
}

.cuf-how-it-works h5 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cuf-foreground);
}

.cuf-steps {
    margin: 0 0 1.5rem 1.25rem;
    color: var(--cuf-foreground);
}

.cuf-steps li {
    margin-bottom: 0.65rem;
    line-height: 1.6;
}

.cuf-tracking-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.cuf-tracking-card {
    background: var(--cuf-background);
    border: 1px solid var(--cuf-border);
    border-radius: var(--cuf-radius);
    padding: 1.25rem;
    box-shadow: var(--cuf-shadow-sm);
}

.cuf-tracking-card h6 {
    margin: 0 0 0.35rem 0;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 960px) {
    .cuf-onboarding-container {
        padding: 2rem;
    }

    .cuf-onboarding-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .cuf-onboarding-promo {
        padding-right: 0;
        border-right: none;
        padding-bottom: 2rem;
        border-bottom: 1px solid var(--cuf-border);
    }
}

@media (max-width: 700px) {
    .cuf-form-grid {
        grid-template-columns: 1fr;
    }

    .cuf-promo-modal {
        padding: 1.25rem;
    }

    .cuf-promo-modal__content {
        padding: 1.75rem 1.5rem;
    }

    .cuf-tracking-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 540px) {
    .cuf-onboarding-container {
        padding: 1.5rem;
    }

    .cuf-promo-trigger {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .cuf-promo-trigger__button {
        align-self: stretch;
        text-align: center;
    }

    .cuf-tracking-grid {
        grid-template-columns: 1fr;
    }
}

/* Ensure centering inside Grid/Flex themes */
#primary.cuf-single-topic {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  justify-self: center; /* Grid */
  align-self: start;    /* Grid */
}
.site-content #primary.cuf-single-topic { align-self: center; } /* Flex */

/* Original post */
body .cuf-topic-original-post {
  background: var(--cuf-background);
  border: 1px solid var(--cuf-border);
  border-radius: var(--cuf-radius-xl);
  box-shadow: var(--cuf-shadow);
  display: grid;
  grid-template-columns: 140px 1fr; /* widen author column */
  overflow: hidden;
  margin-bottom: 20px;
  padding: 20px;
}

body .cuf-topic-author-info {
  background: var(--cuf-card);
  border-right: 1px solid var(--cuf-border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

body .cuf-topic-author-info .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--cuf-border);
}

body .cuf-topic-author-info .cuf-author-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cuf-foreground);
}

body .cuf-topic-author-info .cuf-author-role {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--cuf-muted);
  color: var(--cuf-muted-foreground);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--cuf-border);
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal; /* allow wrap if needed */
  overflow: visible;
  text-overflow: clip;
  margin-left: auto;
  margin-right: auto;
}

body .cuf-topic-content-wrapper .entry-header {
  padding: 0.75rem 1rem 0.25rem;
  border-bottom: none;
  border-top: 2px solid var(--cuf-secondary);
  background: linear-gradient(180deg, var(--cuf-muted) 0%, rgba(0,0,0,0) 100%);
}

body .cuf-topic-content-wrapper .entry-title {
  margin: 0 0 0.25rem 0;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  line-height: 1.2;
}

body .cuf-topic-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--cuf-muted-foreground);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

/* Accent meta chips */
body .cuf-topic-meta .cuf-chip,
body .cuf-reply-date .cuf-chip {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--cuf-muted);
  color: var(--cuf-muted-foreground);
  font-size: 0.75rem;
  font-weight: 600;
}

body .cuf-topic-content-wrapper .entry-content {
  padding: 1rem;
  line-height: 1.75;
}

/* Content typography inside post/replies */
.cuf-topic-content-wrapper .entry-content p,
.cuf-reply-text p {
  margin: 0 0 0.85rem 0;
}

.cuf-topic-content-wrapper .entry-content ul,
.cuf-reply-text ul { padding-left: 1.25rem; margin: 0 0 0.85rem 0; }
.cuf-topic-content-wrapper .entry-content ol,
.cuf-reply-text ol { padding-left: 1.25rem; margin: 0 0 0.85rem 0; }
.cuf-topic-content-wrapper .entry-content blockquote,
.cuf-reply-text blockquote {
  border-left: 3px solid var(--cuf-secondary);
  margin: 0 0 1rem 0;
  padding: 0.5rem 0 0.5rem 1rem;
  color: var(--cuf-foreground);
  background: var(--cuf-muted);
}

/* Replies */
body .cuf-replies-container { margin-top: 1.25rem; padding-left: 1.25rem; margin-bottom: 10px; }

body .cuf-replies-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--cuf-border);
  margin: 1rem 0 0.75rem 0;
  padding: 0.25rem 0.25rem;
}
body .cuf-replies-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--cuf-foreground);
  padding-left: 10px;
  margin: 0;
}

body .cuf-reply-item {
  background: var(--cuf-background);
  border: 1px solid var(--cuf-border);

  border-radius: var(--cuf-radius);
  box-shadow: var(--cuf-shadow);
  display: grid;
  grid-template-columns: 110px 1fr; /* widen author column */
  overflow: hidden;
  margin-bottom: 2rem;
}

body .cuf-reply-author {
  background: var(--cuf-card);
  border-right: 1px solid var(--cuf-border);
  padding: 0.75rem;
  text-align: center;
}

body .cuf-reply-author .avatar { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--cuf-border); }

body .cuf-reply-content-wrapper { padding: 0; }

body .cuf-reply-header {
  background: transparent;
  border-bottom: 1px solid var(--cuf-border);
  padding: 0.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body .cuf-reply-date { font-size: 0.85rem; color: var(--cuf-muted-foreground); }

body .cuf-reply-content { padding: 0.75rem 1rem; line-height: 1.7; }

/* Subtle accent line for replies */
body .cuf-reply-content { border-left: 3px solid transparent; }
body .cuf-reply-item:hover .cuf-reply-content { border-left-color: var(--cuf-secondary); }
body .cuf-reply-content { border-left-width: 2px; }

/* Breadcrumb spacing tweaks */
.cuf-breadcrumb { margin-bottom: 1rem; padding: 0.5rem 0.75rem; }

/* Reply form spacing */
body .cuf-reply-form-container { padding: 1.5rem; }
.cuf-reply-form-container::before { height: 2px; }
.cuf-reply-form-header h3 { margin: 0 0 0.75rem 0; }

/* Role badge theming */
.cuf-author-role[class*="role-"] { background: var(--cuf-muted); }
.cuf-author-role.role-administrator {
  color: var(--cuf-destructive);
  border-color: var(--cuf-destructive);
  background: rgba(239, 68, 68, 0.08);
}
.cuf-author-role.role-ambassador,
.cuf-author-role.role-cuf_moderator {
  color: var(--cuf-secondary);
  border-color: var(--cuf-secondary);
  background: rgba(146, 52, 53, 0.08);
}
.cuf-author-role.role-cuf_instructor {
  color: var(--cuf-accent);
  border-color: var(--cuf-accent);
  background: rgba(146, 52, 53, 0.08);
}
.cuf-author-role.role-cuf_student,
.cuf-author-role.role-subscriber,
.cuf-author-role.role-member,
.cuf-author-role.role-contributor,
.cuf-author-role.role-author,
.cuf-author-role.role-editor {
  color: var(--cuf-primary);
  border-color: var(--cuf-primary);
  background: rgba(31, 41, 55, 0.08);
}

/* Inline actions */
body .cuf-reply-actions .cuf-delete-link {
  font-size: 0.8125rem;
  padding: 0.25rem 0.5rem;
  color: var(--cuf-destructive);
  border-radius: var(--cuf-radius-sm);
}
body .cuf-reply-actions .cuf-delete-link:hover { background: var(--cuf-destructive); color: #fff; }

/* Responsive tweaks */
@media (max-width: 640px) {
  body .cuf-topic-original-post { grid-template-columns: 64px 1fr; }
  body .cuf-topic-author-info { padding: 0.75rem; }
  body .cuf-topic-content-wrapper .entry-content { padding: 0.75rem; }
  body .cuf-reply-item { grid-template-columns: 56px 1fr; }
  body .cuf-reply-content { padding: 0.75rem; }
}
/* Onboarding form overrides */
.cuf-agree-label { display:flex; align-items:flex-start; gap: 0.6rem; font-size: 0.95rem; color: var(--cuf-foreground); }
.cuf-checkbox-group input[type="checkbox"] { margin-top: 0.2rem; }

/* Ensure select text is not cropped */
.cuf-onboarding-container .cuf-select { min-height: 44px; line-height: 1.35; width: 100%; background: var(--cuf-background); }

/* ========================================
   STRIPE CONNECT PANEL (fm-sp) RE-SKIN
   Uses CUF design tokens for a cohesive look
   ======================================== */
.fm-sp-panel {
  background: var(--cuf-card);
  border: 1px solid var(--cuf-border);
  border-radius: var(--cuf-radius-lg);
  box-shadow: var(--cuf-shadow);
  padding: 1rem 1.25rem;
  width: 100%;
}
.fm-sp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .5rem;
}
.fm-sp-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--cuf-border);
  background: var(--cuf-muted);
  color: var(--cuf-muted-foreground);
  font-size: .75rem;
  font-weight: 600;
}
.fm-sp-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .5rem 0 .25rem;
  flex-wrap: wrap;
}
.fm-sp-actions .button {
  border-radius: var(--cuf-radius);
  border: 1px solid var(--cuf-border);
  background: var(--cuf-card);
  color: var(--cuf-foreground);
  padding: .5rem .9rem;
  line-height: 1.2;
  font-weight: 600;
  cursor: pointer;
}
.fm-sp-actions .button:hover {
  background: var(--cuf-muted);
}
.fm-sp-actions .button.button-primary,
.fm-sp-connect, .fm-sp-continue {
  background: var(--cuf-secondary) !important;
  border-color: var(--cuf-secondary) !important;
  color: var(--cuf-secondary-foreground) !important;
}
.fm-sp-actions .button.button-primary:hover,
.fm-sp-connect:hover, .fm-sp-continue:hover {
  background: #DD6A6C !important;
}
.fm-sp-portal {
  background: var(--cuf-card);
  color: var(--cuf-foreground);
  border: 1px solid var(--cuf-border);
}
.fm-sp-portal:hover { background: var(--cuf-muted); }
.fm-sp-delete { background: var(--cuf-destructive); color: var(--cuf-destructive-foreground); border-color: var(--cuf-destructive); }
.fm-sp-delete:hover { background: #dc2626; }
.fm-sp-foot { display:block; color: var(--cuf-muted-foreground); margin-top: .25rem; }
.fm-sp-msg { margin-top: .25rem; color: var(--cuf-destructive); font-size: .9rem; }

/* Creator sidebar quick-action alignment with fm-sp-portal button */
.mp-creator-card .fm-sp-panel { border: none; box-shadow: none; padding: 0; }

@media (max-width: 768px) {
  .fm-sp-row { flex-direction: column; align-items: flex-start; gap: .35rem; }
  .fm-sp-actions { width: 100%; }
  .fm-sp-actions .button { width: auto; }
}

/* ========================================
   DASHBOARD GRID & TABLE FIXES - DROP-IN REPLACEMENT
   Add this at the END of your CSS file to override existing styles
   ======================================== */

/* Dashboard Grid - Improved Layout */
.cuf-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  width: 100%;
  margin-bottom: 2rem;
}

/* On larger screens, show sidebar */
@media (min-width: 1200px) {
  .cuf-dashboard-grid {
    grid-template-columns: 1fr 380px;
  }
}

/* Dashboard Main - Full Width Container */
.cuf-dashboard-main {
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

/* Card Content - Better Padding */
.cuf-card-content {
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .cuf-card-content {
    padding: 2rem;
  }
}

/* Member Controls - Full Width Search */
.cuf-member-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.cuf-member-controls .cuf-search-box {
  flex: 1 1 100%;
  min-width: 0;
}

/* Table Container - Proper Overflow Handling */
.cuf-table-container {
  border-radius: var(--cuf-radius-lg);
  border: 1px solid var(--cuf-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--cuf-background);
  box-shadow: var(--cuf-shadow-sm);
  width: 100%;
  margin: 0;
}

/* Member Table - Responsive Base Styles */
.cuf-member-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--cuf-background);
}

/* Table Headers */
.cuf-member-table thead {
  background: var(--cuf-muted);
}

.cuf-member-table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  color: var(--cuf-foreground);
  border-bottom: 2px solid var(--cuf-border);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  background: var(--cuf-muted);
}

/* Table Body */
.cuf-member-table tbody {
  background: var(--cuf-background);
}

.cuf-member-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--cuf-border);
  vertical-align: middle;
}

/* Member Row Hover */
.cuf-member-row {
  transition: background-color 0.2s ease;
}

.cuf-member-row:hover {
  background: var(--cuf-muted);
}

.cuf-member-row:last-child td {
  border-bottom: none;
}

/* Member Info - Better Layout */
.cuf-member-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.cuf-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--cuf-radius);
  border: 2px solid var(--cuf-border);
  flex-shrink: 0;
}

.cuf-member-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

.cuf-member-name {
  font-weight: 500;
  color: var(--cuf-foreground);
  line-height: 1.3;
  word-break: break-word;
}

.cuf-member-email {
  font-size: 0.8125rem;
  color: var(--cuf-muted-foreground);
  line-height: 1.3;
  word-break: break-word;
}

/* Role Badges - Better Sizing */
.cuf-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: var(--cuf-radius);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  line-height: 1;
}

/* Checkbox Column - Centered */
.cuf-checkbox-column {
  width: 50px;
  text-align: center;
  padding: 1rem 0.5rem !important;
}

/* Member Actions Column */
.cuf-member-actions {
  white-space: nowrap;
}

/* No Data Message */
.cuf-no-data {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--cuf-muted-foreground);
  font-style: italic;
  font-size: 0.9375rem;
}

/* ========================================
   MOBILE RESPONSIVE STYLES (Keep Table Format)
   ======================================== */

@media (max-width: 768px) {
  /* Grid to single column */
  .cuf-dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .cuf-dashboard-main {
    width: 100%;
  }

  .cuf-dashboard-sidebar {
    order: -1;
    min-width: 100%;
  }

  /* Card content - reduce padding on mobile */
  .cuf-card-content {
    padding: 1rem;
  }

  /* Table container - enable horizontal scroll */
  .cuf-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--cuf-radius-lg);
  }

  /* Keep table structure, just make it scrollable */
  .cuf-member-table {
    min-width: 600px;
    font-size: 0.8125rem;
  }

  .cuf-member-table th {
    padding: 0.75rem 0.75rem;
    font-size: 0.75rem;
  }

  .cuf-member-table td {
    padding: 0.75rem 0.75rem;
  }

  /* Adjust avatar size on mobile */
  .cuf-avatar {
    width: 36px;
    height: 36px;
  }

  /* Compact member info */
  .cuf-member-info {
    gap: 0.5rem;
  }

  .cuf-member-name {
    font-size: 0.875rem;
  }

  .cuf-member-email {
    font-size: 0.75rem;
  }

  /* Make role badges slightly smaller */
  .cuf-role-badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
  }

  /* Adjust checkbox column */
  .cuf-checkbox-column {
    width: 40px;
  }
}

/* Extra small screens - even more compact */
@media (max-width: 480px) {
  .cuf-card-content {
    padding: 0.75rem;
  }

  .cuf-member-table {
    min-width: 550px;
    font-size: 0.75rem;
  }

  .cuf-member-table th,
  .cuf-member-table td {
    padding: 0.625rem 0.5rem;
  }

  .cuf-avatar {
    width: 32px;
    height: 32px;
  }
}

/* ========================================
   TABLET RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 1024px) and (min-width: 769px) {
  .cuf-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .cuf-dashboard-sidebar {
    order: -1;
  }

  /* Keep table format but adjust spacing */
  .cuf-member-table th,
  .cuf-member-table td {
    padding: 0.875rem 1rem;
    font-size: 0.8125rem;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .cuf-table-container {
    border: 1px solid #ddd;
    overflow: visible;
  }

  .cuf-member-table {
    page-break-inside: avoid;
  }

  .cuf-member-row {
    page-break-inside: avoid;
  }

  .cuf-checkbox-column {
    display: none;
  }

  .cuf-member-actions {
    display: none;
  }
}
