.mepr-partner-access a:before {
  content: "\f007";
}

/* General Layout and Typography */
.mepr-manage_sub_accounts-wrapper {
  color: #333;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
  background-color: #fff;
  border-radius: 6px;
}

.mepr-manage_sub_accounts-wrapper {
  @media screen and (min-width: 992px) {
    padding-left: 40px;
  }
}

.mepr-manage_sub_accounts-wrapper h3 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #2c3e50;
  border-bottom: 1px solid #eaeaea;
  padding-bottom: 12px;
}

.mepr-manage_sub_accounts-wrapper h4 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 16px;
  color: #34495e;
}

/* Team Members Count */
#mpca_sub_accounts_used h4 {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 16px;
}

/* Buttons and Inputs */
.mepr-manage_sub_accounts-wrapper button,
.mepr-manage_sub_accounts-wrapper input[type="submit"] {
  background-color: #188ece !important;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mepr-manage_sub_accounts-wrapper button:hover,
.mepr-manage_sub_accounts-wrapper input[type="submit"]:hover {
  background-color: #188ece !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.mepr-manage_sub_accounts-wrapper input[type="text"],
.mepr-manage_sub_accounts-wrapper input[type="email"],
.mepr-manage_sub_accounts-wrapper select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mepr-manage_sub_accounts-wrapper input[type="text"]:focus,
.mepr-manage_sub_accounts-wrapper input[type="email"]:focus,
.mepr-manage_sub_accounts-wrapper select:focus {
  border-color: #188ece !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

#mpca-add-sub-user {
  margin-bottom: 0;
  padding-bottom: 24px;
}

/* Add Team Member Button */
#mpca-add-sub-user-btn-alt {
  display: inline-block;
  font-weight: 500;
  text-align: center;
}

/* Team Members Form */
#mpca-add-sub-user-form {
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 6px;
  border: 1px solid #eaeaea;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#mpca-add-sub-user-form label {
  display: block;
  margin-bottom: 16px;
}

#mpca-add-sub-user-form label span {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #555;
}

#mpca-add-sub-user-form label span.welcome-email {
  display: inline-block;
}

/* OR Separator */
.or-separator {
  margin: 18px 0;
  text-align: center;
  position: relative;
}

.or-separator:before {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  background: #e5e5e5;
  position: absolute;
  top: 50%;
  z-index: 1;
}

.or-separator span {
  background: #f8f9fa;
  padding: 0 15px;
  position: relative;
  z-index: 2;
  color: #666;
  font-weight: 500;
}

/* Access Level Field */
.access-level-field {
  margin-bottom: 20px;
}

.access-level-field label {
  display: block;
  margin-bottom: 6px;
}

.access-level-field span {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: #555;
}

.access-level-field select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #fff;
}

.access-level-field .description {
  font-size: 13px;
  font-style: italic;
  color: #666;
  margin-top: 6px;
}

/* Access Level Badges */
.mp-access-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
}

.mp-access-partner {
  background-color: #e3f2fd;
  color: #188ece;
  border: 1px solid #bbdefb;
}

.mp-access-guest {
  background-color: #fff3e0;
  color: #e65100;
  border: 1px solid #ffe0b2;
}

/* Search Box */
.mpca-search {
  margin-bottom: 22px;
}

.mpca-search input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background-color: #f9f9f9;
  transition: all 0.2s ease;
}

.mpca-search input:focus {
  border-color: #188ece !important;
  background-color: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Team Members Table */
.mpca-table-overflow {
  overflow: visible;
  margin-bottom: 25px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

.mepr-account-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 20px;
  border: none !important;
  /* overflow: hidden; */

  thead {
    border-bottom: 1px solid #eaeaea;
  }

  td,
  th {
    border: none !important;
    padding-top: 20px;
    padding-bottom: 20px;
  }

  tr {
    border: none !important;
  }
}

.mp_wrapper table.mepr-account-table th,
.mepr-account-table th {
  background-color: #f5f7fa;
  padding: 16px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #e0e0e0;
  color: #445870;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mp_wrapper table.mepr-account-table td,
.mepr-account-table td {
  padding: 10px 16px;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: middle;
  transition: background-color 0.2s;
  border-left: none;
  font-weight: normal;
}

.mpca-sub-accounts-row-fullname {
  font-weight: 600;
}

.mepr-account-table tr:hover {
  background-color: #f9fbfd;
}

.mepr-account-table tr:last-child td {
  border-bottom: none;
}

.mepr-account-table thead tr th:last-child {
  text-align: center;
}

.mepr-alt-row {
  background-color: #f8f9fa;
}

/* Table Actions */
.mp-change-access,
.mpca-remove-sub-account,
.mpca-make-parent {
  display: inline-block;
  margin-right: 12px;
  font-size: 13px;
  text-decoration: none;
  color: #188ece !important;
  font-weight: 500;
  transition: all 0.2s ease;
}

.mp-change-access:hover,
.mpca-remove-sub-account:hover,
.mpca-make-parent:hover {
  color: #188ece;
  text-decoration: underline;
}

.mpca-remove-sub-account {
  color: #e74c3c;
}

.mpca-remove-sub-account:hover {
  color: #c0392b;
}

.mpca-course-sub-account-progress {
  display: none !important;
}

/* Pagination */
#mepr-sub-account-paging {
  margin: 20px 0;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
}

#mepr-sub-account-paging a {
  display: inline-block;
  padding: 8px 15px;
  background-color: #f5f7fa;
  color: #188ece !important;
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  font-size: 14px;
  transition: all 0.2s ease;
  font-weight: 500;
}

#mepr-sub-account-paging a:hover {
  background-color: #eaeaea;
  color: #188ece;
  border-color: #bdc3c7;
}

/* Export Button */
#mpca_export_sub_accounts {
  margin-top: 20px;
  margin-bottom: 20px;
}

#mpca_export_sub_accounts a {
  display: inline-block;
  padding: 10px 15px;
  background-color: #f5f7fa;
  color: #188ece !important;
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  font-size: 14px;
  transition: all 0.2s ease;
  font-weight: 500;
}

#mpca_export_sub_accounts a:hover {
  background-color: #eaeaea;
  color: #188ece;
  border-color: #bdc3c7;
}

/* Team Signup URL */
#mpca_signup_url {
  margin-top: 25px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#mpca_signup_url h4 {
  margin-top: 0;
  color: #2c3e50;
}

#mpca_signup_url p {
  margin-bottom: 15px;
  color: #555;
}

/* Import CSV Section */
#mpca_import_sub_accounts {
  margin-top: 25px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#mpca_import_sub_accounts h4 {
  margin-top: 0;
  color: #2c3e50;
}

/* Checkbox Styling */
.mp_wrapper input[type="checkbox"] {
  margin-right: 8px;
  vertical-align: middle;
}

/* Utility Classes */
.mpca-fat-bottom {
  margin-bottom: 24px;
}

.mpca-fat-top {
  margin-top: 20px;
}

.mpca-hidden {
  display: none;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
  .mp_wrapper {
    padding: 15px 0;
  }

  .mepr-account-table th,
  .mepr-account-table td {
    padding: 10px 8px;
    font-size: 13px;
  }

  .mp-access-badge {
    padding: 4px 8px;
    font-size: 11px;
  }

  #mpca-add-sub-user-form {
    padding: 15px;
  }
}

/* Hide Corporate Account Title */
.mpca-corporate-account h1 {
  display: none;
}

/* Replace With Team Management Title */
.mpca-corporate-account:before {
  content: "Team Management";
  font-size: 28px;
  font-weight: 600;
  display: block;
  margin-bottom: 20px;
  color: #2c3e50;
}

/* Mobile-Optimized Team Members Table with Proper Content Alignment
   This version focuses on consistent left/right alignment */

/* Base table styling */
.mepr-account-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 14px;
  background: transparent;
  border: none;
}

/* Desktop styles */
@media screen and (min-width: 768px) {
  .mepr-account-table {
    border: 1px solid #e5e7eb;
    background: #fff;
  }

  .mepr-account-table thead {
    background-color: #f8fafc;
  }

  .mepr-account-table th {
    padding: 12px 8px;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e5e7eb;
  }

  .mepr-account-table td {
    padding: 12px 8px;
    color: #334155;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
  }

  .mepr-account-table tr:hover {
    background-color: #f9fafb;
  }

  .mepr-alt-row {
    background-color: #f8fafc;
  }

  /* Action links in desktop view */
  .mpca-remove-sub-account,
  .mp-change-access,
  .mpca-make-parent {
    display: block;
    margin: 5px 0;
    padding: 4px 0;
    font-size: 13px;
    text-decoration: none;
    color: #2563eb;
  }

  .mpca-remove-sub-account {
    color: #ef4444;
  }

  .mpca-remove-sub-account:hover,
  .mp-change-access:hover,
  .mpca-make-parent:hover {
    text-decoration: underline;
  }
}

/* Mobile styles - with proper content alignment */
@media screen and (max-width: 767px) {
  /* Hide original table structure */
  .mepr-account-table,
  .mepr-account-table tbody {
    display: block;
    width: 100%;
  }

  /* Hide the original thead */
  .mepr-account-table thead {
    display: none;
  }

  /* Create clean cards for each member */
  .mepr-account-table tr {
    display: block;
    background: #fff;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
  }

  /* Add section title to each card */
  .mepr-account-table tr:before {
    content: "Team Member Details";
    display: block;
    background-color: #2563eb;
    color: white;
    font-weight: 600;
    padding: 12px 15px;
    font-size: 15px;
    text-align: center;
  }

  /* Hide cells we don't need on mobile */
  .mepr-account-table td:nth-child(3),
  .mepr-account-table td:nth-child(4),
  .mepr-account-table td:nth-child(6) {
    display: none;
  }

  /* Style each data cell - TWO COLUMN LAYOUT */
  .mepr-account-table td {
    display: flex;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    align-items: center;
  }

  /* Clear labels for each field - LEFT SIDE */
  .mepr-account-table td:before {
    content: attr(data-label);
    font-weight: 600;
    color: #475569;
    width: 40%;
    padding-right: 10px;
    display: inline-block;
    text-align: left;
  }

  /* Content values - RIGHT SIDE */
  .mepr-account-table td span,
  .mepr-account-table td a:not(.mpca-remove-sub-account):not(.mp-change-access):not(.mpca-make-parent) {
    flex: 1;
    text-align: right;
  }

  /* Fix for username content alignment */
  .mepr-account-table td:first-child {
    background-color: #f8fafc;
  }

  /* Fix for direct text content (when not wrapped in elements) */
  .mepr-account-table td {
    justify-content: space-between;
  }

  /* Force direct text to align right */
  .mepr-account-table td:after {
    content: "";
    display: inline-block;
    flex: 1;
  }

  /* Access level badge styling */
  .mp-access-badge {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    margin-left: auto;
    text-align: center;
    display: inline-block;
  }

  .mp-access-partner {
    background-color: #dbeafe;
    color: #2563eb;
  }

  .mp-access-guest {
    background-color: #fef3c7;
    color: #d97706;
  }

  /* Action buttons container - last cell */
  .mepr-account-table td:last-child {
    display: flex;
    flex-direction: column;
    padding: 0;
    border-bottom: none;
  }

  /* No label for actions */
  .mepr-account-table td:last-child:before {
    display: none;
  }

  /* Style action links as proper buttons */
  .mpca-remove-sub-account,
  .mp-change-access,
  .mpca-make-parent {
    margin: 0;
    padding: 12px 15px;
    text-align: center;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
    display: block;
    width: 100%;
  }

  /* Last action button has no border */
  .mpca-remove-sub-account:last-child,
  .mp-change-access:last-child,
  .mpca-make-parent:last-child {
    border-bottom: none;
  }

  /* Remove button styling */
  .mpca-remove-sub-account {
    background-color: #fee2e2;
    color: #ef4444;
  }

  .mpca-remove-sub-account:hover,
  .mpca-remove-sub-account:active {
    background-color: #fecaca;
    text-decoration: none;
  }

  /* Change button styling */
  .mp-change-access {
    background-color: #dbeafe;
    color: #2563eb;
  }

  .mp-change-access:hover,
  .mp-change-access:active {
    background-color: #bfdbfe;
    text-decoration: none;
  }
}

/* Search box styling */
.mpca-search input {
  width: 100%;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 14px;
  background-color: #f8fafc;
}

.mpca-search input:focus {
  border-color: #2563eb;
  outline: none;
}

/* Page info */
.mpca-sub-account-page-info {
  font-size: 16px;
  font-weight: bold;
  color: #64748b;
  text-align: center;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mpca-sub-account-table-footer {
  padding: 8px 10px;
  text-align: center;
  border-top: 1px solid #eaeaea;
  font-size: 12px;
  background-color: #f8fafc;
}

/* Team Member Status Banner */
.mp-team-status-banner {
  padding: 12px 15px;
  margin-bottom: 20px;
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
}

.mp-team-banner-partner {
  background-color: #e3f2fd;
  color: #188ece;
  border: 1px solid #bbdefb;
}

.mp-team-banner-guest {
  background-color: #fff3e0;
  color: #e65100;
  border: 1px solid #ffe0b2;
}

/* Admin Team Role Styles */
.mp-team-role {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
}

.mp-team-role.partner {
  background-color: #e3f2fd;
  color: #188ece;
}

.mp-team-role.guest {
  background-color: #fff3e0;
  color: #e65100;
}

.mp-team-role.owner {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.mp-team-banner-owner {
  background-color: #e6f7ff;
  border-left: 4px solid #0088cc;
  padding: 10px 15px;
  margin-bottom: 20px;
  border-radius: 3px;
}

.mp-team-banner-owner a {
  color: #0088cc;
  font-weight: bold;
  text-decoration: none;
}

.mp-team-banner-owner a:hover {
  text-decoration: underline;
}

.mpca-member-actions {
  @media screen and (min-width: 768px) {
    position: relative;
    text-align: center;

    .action-btn {
      background: none !important;
      border: none;
      color: #64748b;
      padding: 8px;
      border-radius: 4px;
      cursor: pointer;
      transition: all 0.2s;
      font-size: 16px;
      font-weight: bold;
      box-shadow: none;
    }

    .action-btn:hover {
      background: #f1f5f9 !important;
      color: #1e293b;
    }

    .action-dropdown {
      position: absolute;
      right: 0;
      top: 100%;
      background: white;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1);
      min-width: 190px;
      z-index: 999;
      display: none;
    }

    .action-dropdown.show {
      display: block;
    }

    .mp-change-access,
    .dropdown-item {
      padding: 12px 16px;
      color: #374151;
      text-decoration: none;
      display: block;
      font-size: 13px;
      transition: all 0.2s;
      border: none;
      background: none;
      width: 100%;
      text-align: left;
      cursor: pointer;
    }

    .mp-change-access:hover,
    .dropdown-item:hover {
      background: #f9fafb;
    }

    .dropdown-item.danger:hover {
      background: #fee2e2;
    }
  }
  .dropdown-item.danger {
    color: #dc2626 !important;
  }

  @media screen and (max-width: 767px) {
    width: 100%;
    .action-btn {
      display: none;
    }
  }
}

#mpca-add-sub-user-form {
  .add-existing-member-wrapper,
  .add-new-member-wrapper {
    border: 1px solid #eaeaea;
    border-radius: 6px;
    padding: 24px;
    transition: all 0.2s;
    background: #fff;

    .field-label {
      font-size: 16px;
      font-weight: 600;
      display: flex;
      align-items: center;
    }

    .help-text {
      color: #718096;
      font-size: 13px;
      line-height: 1;
    }
  }

  .add-existing-member-wrapper {
    margin-bottom: 24px;
  }

  .add-new-member-wrapper {
    margin-top: 24px;
  }
}

#mpca-add-sub-user-form label.form-or-wrapper {
  border-bottom: 1px solid #64748b;

  span {
    background-color: #f8f9fa;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: -14px;
    text-align: center;
    width: 60px;
    color: #64748b;
    font-weight: bold;
  }
}

body.mepr-custom-account-page.mepr-manage_sub_accounts .ac_results {
  /* display: none !important; */
}

#mpca-add-sub-user-form {
  margin-top: 24px;
  .status-message {
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid;
    display: block;
  }

  .status-loading {
    background: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
    font-style: italic;
    border: none;
    display: inline-block;
  }

  .status-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
  }

  .status-info {
    background: #cce7ff;
    color: #004085;
    border-color: #b3d7ff;
  }

  .status-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
  }

  #name-fields {
    margin-top: 16px;
  }

  #name-fields input {
    margin-bottom: 0;
    margin-top: 0;
  }

  .admin-badge {
    background: #ffc107;
    color: #212529;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 5px;
  }

  /* Enhance the find-user input */
  input[name="find-user"] {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
  }

  input[name="find-user"]:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
    outline: none;
  }

  /* Success state for input */
  input[name="find-user"].user-found {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
  }

  /* Info state for input */
  input[name="find-user"].user-new {
    border-color: #17a2b8;
    box-shadow: 0 0 0 2px rgba(23, 162, 184, 0.2);
  }

  /* Error state for input */
  input[name="find-user"].user-error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
  }

  .status-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
  }

  /* Disabled submit button styles */
  input[type="submit"]:disabled,
  button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
  }
}

.mepr-manage_sub_accounts-wrapper {
  .team-add-success {
    text-align: center;

    .success-content {
    }
  }

  .team-add-success {
    background: rgb(212, 237, 218);
    border: 1px solid rgb(195, 230, 203);
    color: rgb(21, 87, 36);
    padding: 15px;
    margin: 20px 0px;
    border-radius: 4px;
    animation: slideDown 0.3s ease-out;
    position: relative;
  }

  .success-content {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .success-icon {
    font-size: 24px;
  }

  .success-text {
    flex: 1;
    color: #155724;
    font-weight: 500;
  }

  .success-close {
    border: none;
    font-size: 24px;
    color: #155724;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    background: none !important;
    position: absolute;
    top: 4px;
    right: 4px;
    box-shadow: none !important;
  }

  .success-close:hover {
    opacity: 0.7;
    background-color: transparent !important;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

.team-name-container {
  .team-name-display {
    font-weight: 600;
    font-size: 20px;
    font-style: italic;
    opacity: 0.8;
    flex: 1 0 100%;
  }

  #teamNameContainer {
    display: flex;
    flex-wrap: wrap;
  }

  .edit-hint {
    font-size: 12px;
  }

  .status-message {
    font-size: 12px;
    margin-left: 5px;

    &.status-saved {
      color: #188ece;
    }

    &.status-error {
      color: #cf2e2e;
    }
  }
}

.mepr-team_info-wrapper {
  .internal-name {
    color: #333;
    font-style: italic;
  }
}
